Ejemplo n.º 1
0
 def update_color_info(self, color_string, clear_highlight=True):
     '''Update color info.'''
     self.color_string = color_string
     (self.color_r, self.color_g, self.color_b) = color_hex_to_rgb(self.color_string)
     self.color_r_spin.update(self.color_r)
     self.color_g_spin.update(self.color_g)
     self.color_b_spin.update(self.color_b)
     self.color_hex_entry.set_text(self.color_string)
     if not color_string.startswith("#"):
         color_string = "#" + color_string
     self.color_hsv.set_current_color(gtk.gdk.color_parse(color_string))
     
     if clear_highlight:
         self.color_select_view.clear_highlight()
     
     self.color_display_button.queue_draw()
Ejemplo n.º 2
0
    def update_color_info(self, color_string, clear_highlight=True):
        '''
        Update color information.

        @param color_string: Hex color string.
        @param clear_highlight: Whether clear color select view's highlight status, default is True.
        '''
        self.color_string = color_string
        (self.color_r, self.color_g, self.color_b) = color_hex_to_rgb(self.color_string)
        self.color_r_spin.update(self.color_r)
        self.color_g_spin.update(self.color_g)
        self.color_b_spin.update(self.color_b)
        self.color_hex_entry.set_text(self.color_string)
        if not color_string.startswith("#"):
            color_string = "#" + color_string
        self.color_hsv.set_current_color(gtk.gdk.color_parse(color_string))
        
        if clear_highlight:
            self.color_select_view.clear_highlight()
        
        self.color_display_button.queue_draw()
Ejemplo n.º 3
0
    def update_color_info(self, color_string, clear_highlight=True):
        '''
        Update color information.

        @param color_string: Hex color string.
        @param clear_highlight: Whether clear color select view's highlight status, default is True.
        '''
        self.color_string = color_string
        (self.color_r, self.color_g,
         self.color_b) = color_hex_to_rgb(self.color_string)
        self.color_r_spin.update(self.color_r)
        self.color_g_spin.update(self.color_g)
        self.color_b_spin.update(self.color_b)
        self.color_hex_entry.set_text(self.color_string)
        if not color_string.startswith("#"):
            color_string = "#" + color_string
        self.color_hsv.set_current_color(gtk.gdk.color_parse(color_string))

        if clear_highlight:
            self.color_select_view.clear_highlight()

        self.color_rgb_box.queue_draw()
        self.color_display_button.queue_draw()