def strip_transparency(self, color, track_darkness=False): if color is None: return color ba = "AA" rgba = RGBA(color.replace(" ", "")) rgba.apply_alpha(self.bground + ba if self.bground != "" else "#FFFFFF%s" % ba) return rgba.get_rgb()
def strip_transparency(self, color, track_darkness=False, simple_strip=False): if color is None: return color rgba = RGBA(color.replace(" ", "")) if not simple_strip: rgba.apply_alpha(self.bground if self.bground != "" else "#FFFFFF") return rgba.get_rgb()
def strip_transparency(self, color, track_darkness=False, simple_strip=False): if color is None: return color rgba = RGBA(color.replace(" ", "")) if not simple_strip: rgba.apply_alpha(self.bground if self.bground != "" else "#FFFFFF") if track_darkness: lumens = rgba.luminance() if self.dark_lumens is None or lumens < self.dark_lumens: self.dark_lumens = lumens return rgba.get_rgb()
def strip_transparency(self, color, track_darkness=False): if color is None: return color ba = "AA" rgba = RGBA(color.replace(" ", "")) rgba.apply_alpha(self.bground + ba if self.bground != "" else "#FFFFFF%s" % ba) if track_darkness: lumens = rgba.luminance() if self.dark_lumens is None or lumens < self.dark_lumens: self.dark_lumens = lumens return rgba.get_rgb()