From: Paul K. <pki...@em...> - 2008-09-24 13:57:51
|
On Sep 23, 2008, at 8:29 PM, Tom Holroyd wrote: > Repost; the list bounced my last attempt. > > On Fri, 2008-09-19 at 18:42 -0400, Tom Holroyd wrote: >> On Thu, 2008-09-18 at 20:40 +0200, Jouni K. Seppänen wrote: >>> I would prefer something like the following options: >>> >>> fc={'orange': 20, 'white': None} >>> fc=[[20, 'orange'], [None, 'white']] >>> fc=ColorMixture('orange', 20, 'white') # where ColorMixture >>> is a fairly >>> # trivial class >> >> +1 >> >> simpler, easier to read & write, less ad-hoc >> >> I'd go ahead and make ColorMixture a fancy class with __rmul__ and >> __add__ methods to allow things like >> orange = ColorMixture(255, 165, 0) >> blue = ColorMixture(0, 0, 255) >> mycolor = .7 * orange + .2 * blue hsv mixing is much more useful. Take a known color and you can imagine what a darker/lighter or paler/deeper version would look like, such as dark green or pale blue. These are just value and saturation. Even hue can be imagined to some degree (bluish, greenish, etc.) to move one hue toward another, but that is harder to imagine across the circle (e.g, greenish purple or bluish yellow). Rather than averaging it would be easier to move some percentage toward the other color, such as blue, but hue 20% toward green. This can probably be expressed in operations on a color mixture class as above. Also a linear perceptual scale would work better than HSV but I don't know of one off hand. - Paul |