Пример #1
0
 def srgb(self):
     """
     Color value expressed as an sRGB triplet
     """
     if 'srgb' not in self._cache:
         self._cache['srgb'] = ct.srgbTF(self.rgb)
     return self._cache['srgb']
Пример #2
0
 def srgb(self, color):
     # Validate
     color, space = self.validate(color=color, space='srgb')
     if space != 'srgb':
         setattr(self, space)
         return
     # Apply via rgba255
     self.rgb = ct.srgbTF(color, reverse=True)
     # Clear outdated values from cache
     self._cache = {'srgb': color}
Пример #3
0
 def srgbTF(self):
     if 'srgbTF' not in self._cache:
         self._cache['srgbTF'] = ct.srgbTF(self.rgb)
     return self._cache['srgbTF']