color pallet  
Author Message
Rob McDonald





PostPosted: 2005-12-28 22:57:00 Top

java-programmer, color pallet I'm coding up a routine to dispaly a stacked bar graph using
Graphics2D. Each bar is made by a bunch of rectangles representing
each contributor. The color of each contributor should be different.

I need a way to assign these colors. The number of contributors can
change at runtime. Sequential colors should be well differentiated.

Does anyone have any suggestions for accomplishing this? I'd rather
not make the user specify colors at runtime.

Thanks,

Rob

 
Roedy Green





PostPosted: 2005-12-29 1:24:00 Top

java-programmer >> color pallet On 28 Dec 2005 06:56:39 -0800, "Rob McDonald"
<email***@***.com> wrote, quoted or indirectly quoted someone
who said :

>Does anyone have any suggestions for accomplishing this? I'd rather
>not make the user specify colors at runtime.

have a look at http://mindprod.com/jgloss/graph.html

There are all kinds of packages. Surely one will do what you want off
the shelf. If not, you can simply create your own colour schemes for 1
to 10 colours. If you wanted to get really fancy you could use
http://mindprod.com/products.html#WAVELENGTH

You could divide the spectrum evenly and it will generate you the
colours.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Rob McDonald





PostPosted: 2005-12-29 12:09:00 Top

java-programmer >> color pallet There are enough special little features that I want, that I think it
will be easier to start from scratch. I'll take a look at them to see
if any of them have a color selection routine I can borrow.

The spectrum routine is really neat, but just about the exact opposite
of what I want. If you start at one point in the rainbow and march
along in one direction, then neighboring boxes will be virtually
indistinguishible. Instead, I need to jump around in the spectrum in
some way... I may have a lot of contributors, so each box will be set
up with a listener, so when you hover over it, it will tell you which
contributor it is. (One of those little features I don't think typical
packages will have.)

Rob