def _set_foreground(self, value, attrlist): if value not in COLOR_RGB: logger.info('This color is not supported => %s', value) color = COLOR_RGB.get(value, COLOR_RGB['black']) if hasattr(Pango, 'AttrForeground'): attrlist.change(Pango.AttrForeground( color[0], color[1], color[2], 0, -1))
def on_dtg_colorbutton_color_set(self, widget): self.gscreen.set_dtg_color() color = self.data.dtg_color fg_color = pango.AttrForeground(color[0], color[1], color[2], 0, 11) for i in self.data.axis_list: axis = "dro_%s3" % i attr = self.widgets[axis].get_attributes() attr.insert(fg_color) self.widgets[axis].set_attributes(attr)