When the user changes the current color, either by clicking on it in the color name pick list, or by adjusting one of the color parameter sliders, this method is called to display the new color's name.
# - - - C o l o r R e a d o u t . s e t def set ( self, color ): """Change the currently selected color. """
Translating a color into
"#RRGGBB" is done
Color.__str__() method. The
widgets that display this string are linked to control
variables, so a call to the control variable's
.set() method changes the displayed label. See
Section 16.3, “
#-- 1 -- # [ if self.isText() -> # self's text color := color # else -> # self's background color := color ] self.internalSet ( color )
External observers must also be notified that the current color has changed.
#-- 2 -- if self.__callback is not None: self.__callback ( )