Esempio n. 1
0
 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()
Esempio n. 2
0
 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()
Esempio n. 3
0
 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()
Esempio n. 4
0
 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()
Esempio n. 5
0
 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()