コード例 #1
0
ファイル: ExportBbcode.py プロジェクト: Yaeger/ExportHtml
 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()
コード例 #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()
コード例 #3
0
ファイル: ExportHtml.py プロジェクト: Gargron/ExportHtml
 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()
コード例 #4
0
ファイル: ExportHtml.py プロジェクト: zolrath/ExportHtml
 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()
コード例 #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()
コード例 #6
0
ファイル: ExportHtml.py プロジェクト: Gargron/ExportHtml
 def apply_color_change(self, color, shift_factor):
     rgba = RGBA(color)
     if shift_factor is not None:
         rgba.brightness(shift_factor)
     return rgba.get_rgb()
コード例 #7
0
ファイル: ExportHtml.py プロジェクト: Gargron/ExportHtml
 def filter_color(color):
     rgba = RGBA(color)
     for f in self.filter:
         name = f[0]
         value = f[1]
         if name == "grayscale":
             rgba.grayscale()
         elif name == "sepia":
             rgba.sepia()
         elif name == "saturation":
             rgba.saturation(value)
         elif name == "invert":
             rgba.invert()
         elif name == "brightness":
             rgba.brightness(value)
         elif name == "hue":
             rgba.hue(value)
         elif name == "colorize":
             rgba.colorize(value)
     return rgba.get_rgba()
コード例 #8
0
 def filter_color(color):
     rgba = RGBA(color)
     for f in self.filter:
         name = f[0]
         value = f[1]
         if name == "grayscale":
             rgba.grayscale()
         elif name == "sepia":
             rgba.sepia()
         elif name == "saturation":
             rgba.saturation(value)
         elif name == "invert":
             rgba.invert()
         elif name == "brightness":
             rgba.brightness(value)
         elif name == "hue":
             rgba.hue(value)
         elif name == "colorize":
             rgba.colorize(value)
     return rgba.get_rgba()
コード例 #9
0
 def apply_color_change(self, color, shift_factor):
     rgba = RGBA(color)
     if shift_factor is not None:
         rgba.brightness(shift_factor)
     return rgba.get_rgb()