Abstract
Describes the implementation of huey, a graphical application for selecting colors and fonts, using the Python programming language and the Tkinter widget set.
This publication is available in Web form and also as a PDF document. Please
forward any comments to tcc-doc@nmt.edu.
Table of Contents
main(): The main programclass Color: A specific colorclass ColorModel: Base class for color
modelsclass HSVModel: Hue-saturation-value color
modelclass RGBModel: Red-green-blue color
modelclass CMYModel: Cyan-magenta-yellow color
modelclass Application: The outermost frameclass MenuBar: General controlsMenuBar.__init__(): ConstructorMenuBar.__createHelp(): Create the
menuMenuBar.__cascadeNamePicker()MenuBar.__helpTyping()MenuBar.__helpPicking()MenuBar.__cascadeAdjuster()MenuBar.__helpReadout()MenuBar.__helpModelSelector()MenuBar.__helpHSV()MenuBar.__helpRGB()MenuBar.__helpCMY()MenuBar.__helpSliders()MenuBar.__cascadeViewing()MenuBar.__helpSwatch()MenuBar.__cascadeFonts()MenuBar.__helpFontFamily()MenuBar.__helpFontSize()MenuBar.__helpFontStyle()MenuBar.__helpImporting()MenuBar.__helpAuthor()MenuBar.__dialog(): Pop up a dialog
widgetclass NamePicker: Select colors by nameclass PickList: The color names pick
listPickList class constantsPickList: Default color listPickList.lookupName(): Convert a color name
to a color valuePickList.__init__(): ConstructorPickList.__addColors(): Populate the color
listPickList.__findColorsFile(): Read the
rgb.txt filePickList.__readColorsFile(): Process the
rgb.txt filePickList.__readColorLine(): Process one
line from rgb.txtPickList.__convert8(): Convert an 8-bit
numberPickList.__useDefaultColors(): Set up a
default color listPickList.__cleanColorMap(): Remove redundant
colorsPickList.__nameCleaner(): Remove redundant
color namesPickList.__anglicize(): Convert
“gray” to “grey”PickList.__lowerize(): Convert
intercapitalized names to lowercasePickList.__purgeName(): Remove one redundant
color namePickList.__pickHandler(): Someone clicked on
a color nameclass Adjuster: Color adjustment and
color model selectionAdjuster.set(): Change the colorAdjuster.textColor(): Return the
current text colorAdjuster.bgColor(): Return the
current text colorAdjuster.isText(): Which color is being
displayed?Adjuster.__init__(): ConstructorAdjuster.__createWidgets(): Create internal
widgetsAdjuster.__readoutHandler(): Change between
text and background colorsAdjuster.__modelHandler(): Change the
current color modelAdjuster.__sliderHandler(): Handler for
slider changesclass ColorReadout: Text and background color
readoutsColorReadout.isText(): Which color are we
displaying?ColorReadout.set(): Change the displayed
colorColorReadout.internalSet()ColorReadout.textColor(): Return the
current text colorColorReadout.bgColor(): Return the
current background colorColorReadout.__init__(): ConstructorColorReadout.__createWidgets()ColorReadout.__radioHandler(): Radiobutton
state change handlerColorReadout.__fixNames(): Prevent
user modification of the Entry
widgetsclass ModelSelector: Widgets to select a color
modelclass ColorSliders: Color model parameter
slidersclass ParamSlider: Scale widget for a color
model parameterParamSlider.get(): Retrieve the current
parameter valueParamSlider.setModel(): Change the color
modelParamSlider.setColor(): Change the current
colorParamSlider.__init__(): ConstructorParamSlider.__createWidgets()ParamSlider.__plusHandler(): Increment the
parameterParamSlider.__minusHandler(): Decrement the
parameterParamSlider.__scaleHandler(): Somebody
dragged the scaleclass Swatch: Font and color samples