def update(self): if isinstance(self.color, str): try: self.color = cms.hexcolor_to_rgba(self.color) except: self.color = cms.hexcolor_to_rgba(self.config.layer_color) stroke = self.style[1] if stroke: stroke[2] = [uc2const.COLOR_RGB, self.color, 1.0, '']
def update(self): if isinstance(self.color, str): try: self.color = cms.hexcolor_to_rgba(self.color) except: self.color = cms.hexcolor_to_rgba(self.config.layer_color) stroke = self.style[1] if stroke: stroke[2] = [uc2const.COLOR_RGB , self.color, 1.0, '']
def update(self): if isinstance(self.color, str): try: self.color = cms.hexcolor_to_rgba(self.color) except: self.color = cms.hexcolor_to_rgba(self.config.layer_color) stroke = self.style[1] if stroke: stroke[2] = [uc2const.COLOR_RGB , self.color[:3], self.color[3], ''] if len(self.properties) == 3: self.properties += [1, ]
def on_hex_change(self): hexcolor = self.html.get_color() if len(hexcolor) == 7: self.color[1] = cms.hexcolor_to_rgb(hexcolor) self.color[2] = 1.0 elif len(hexcolor) == 9: r, g, b, a = cms.hexcolor_to_rgba(hexcolor) self.color[1] = [r, g, b] self.color[2] = a if self.callback: self.callback() else: self.update()