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']
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}
def srgbTF(self): if 'srgbTF' not in self._cache: self._cache['srgbTF'] = ct.srgbTF(self.rgb) return self._cache['srgbTF']