Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2005

Tip: Looking for answers? Try searching our database.

color pallet

Thread view: 
Rob McDonald - 28 Dec 2005 14:56 GMT
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 - 28 Dec 2005 17:24 GMT
On 28 Dec 2005 06:56:39 -0800, "Rob McDonald"
<rob.a.mcdonald@gmail.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.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Rob McDonald - 29 Dec 2005 04:08 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.