diff options
author | Barry Warsaw <barry@python.org> | 1998-02-13 21:28:14 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1998-02-13 21:28:14 (GMT) |
commit | 79a787931867fcbd6a6d6a78c25726382cc88bf0 (patch) | |
tree | 0a6180218a17be24e83eeb6d01e752bfe242dbfa /Tools | |
parent | 2662e15f5895062f03c2759c1b7c87b22b63182a (diff) | |
download | cpython-79a787931867fcbd6a6d6a78c25726382cc88bf0.zip cpython-79a787931867fcbd6a6d6a78c25726382cc88bf0.tar.gz cpython-79a787931867fcbd6a6d6a78c25726382cc88bf0.tar.bz2 |
fixed the generators
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/pynche/PyncheWidget.py | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/Tools/pynche/PyncheWidget.py b/Tools/pynche/PyncheWidget.py index 106dd1f..cac8a53 100644 --- a/Tools/pynche/PyncheWidget.py +++ b/Tools/pynche/PyncheWidget.py @@ -19,20 +19,23 @@ def constant(numchips): numchips = numchips - 1 return seq -def constant_red_generator(numchips, rgbtuple): - red = rgbtuple[0] +# red variations, green+blue = cyan constant +def constant_cyan_generator(numchips, rgbtuple): + red, green, blue = rgbtuple seq = constant(numchips) - return map(None, [red] * numchips, seq, seq) + return map(None, seq, [green] * numchips, [blue] * numchips) -def constant_green_generator(numchips, rgbtuple): - green = rgbtuple[1] +# green variations, red+blue = magenta constant +def constant_magenta_generator(numchips, rgbtuple): + red, green, blue = rgbtuple seq = constant(numchips) - return map(None, seq, [green] * numchips, seq) + return map(None, [red] * numchips, seq, [blue] * numchips) -def constant_blue_generator(numchips, rgbtuple): - blue = rgbtuple[2] +# blue variations, red+green = yellow constant +def constant_yellow_generator(numchips, rgbtuple): + red, green, blue = rgbtuple seq = constant(numchips) - return map(None, seq, seq, [blue] * numchips) + return map(None, [red] * numchips, [green] * numchips, seq) @@ -53,13 +56,16 @@ class PyncheWidget(Pmw.MegaWidget): group = Pmw.Group(parent, tag_text='Color Selectors') group.pack(side=TOP, expand=YES, fill=BOTH) self.__reds = StripWidget(group.interior(), - generator=constant_red_generator) + generator=constant_cyan_generator, + axis=0) self.__reds.pack() self.__blues = StripWidget(group.interior(), - generator=constant_blue_generator) + generator=constant_magenta_generator, + axis=1) self.__blues.pack() self.__greens = StripWidget(group.interior(), - generator=constant_green_generator) + generator=constant_yellow_generator, + axis=2) self.__greens.pack() # create chip window |