Auto color selection PIL

Xiaolei propheci at gmail.com
Wed Sep 27 16:29:56 EDT 2006


Hi,

I'm trying to plot some points in an image.  Each point has an
associating type and I'd like to have different colors (preferrably of
high contrast) for different types.  The number of types in the data
file is unknown a priori.  Is there a way to do this at runtime?

The "solution" I have so far has been to manually create a list of
10-20 contrasting colors and just go off that list at runtime.  This
works most of the time since the number of types is usually less than
10.  But I'd like a general solution.

Thank you.




More information about the Python-list mailing list