color mix

Michael Droettboom <mdroe@...31...> writes:

That's a cool feature, and one I have not come across before.

I agree that it's a neat idea. However, I would prefer a way to specify
color mixtures that is not based on parsing strings but on Python data
structures, e.g. instead of

                     fc="orange!20!white", # 20% orange + 80% white

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

This way we could make mixtures of any color specifications. (What if
you wanted to specify a mixture of mixtures? This situation might not
arise in user code directly, but what if the user is programmatically
creating colors?)

                     fc="aqua!50!green!20!white",

So this would be something like

    fc={'aqua': 50, 'green': 20, 'white': None}
    fc=[[50, 'aqua'], [20, 'green'], [None, 'white']]
    fc=ColorMixture('aqua', 50, 'green', 20, 'white')

···

--
Jouni K. Sepp�nen