def set_color_on_controls(self, color):
        """Set current color to given one."""
        ### reference the rgb entries
        entries = self.entry_map["rgb"]

        ### check whether an alpha value was provided
        try:
            color[3]

        ### if it was not, set an 'include_alpha'
        ### variable to False
        except IndexError:
            include_alpha = False

        ### otherwise, update the entry references to
        ### include the alpha entry and set an
        ### 'include_alpha' variable to True

        else:

            include_alpha = True
            entries = entries + [self.entry_map["alpha"]]

        ### set each entry with its respective value

        for entry, value in zip(entries, color):
            entry.set(value, False)

        ### set alpha checkbutton to value on the
        ### 'include_alpha' variable
        self.alpha_checkbutton.set(include_alpha, False)

        ### set alpha scale according to absence/presence
        ### of an alpha value

        ## retrieve/define the alpha value
        alpha_value = value if include_alpha else 255

        ## set the scale widget to the converted alpha value
        self.scale_map["alpha"].set(alpha_value, False)

        ### finally update the resulting color value
        ### and perform additional tasks
        self.update_from_rgb_entry()
Set current color to given one.
nodezator/colorsman/editor/widgetop.py