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
>
> like,
>
> class cm:
> def __init__(self, r, g, b):
> self.r = r
> self.g = g
> self.b = b
> def __rmul__(self, a):
> return cm(a * self.r, a * self.g, a * self.b)
> def __add__(self, a):
> return cm(a.r + self.r, a.g + self.g, a.b + self.b)
>
--
Elephants can paint.
http://www.elephantart.com/catalog/thailand.php
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel