View Single Post
Old 11-03-2005, 12:31 PM   #1
ecarmody
Thumbs Must Hurt
 
Join Date: Apr 2005
Location: Portland, OR., USA
Model: 9800
Carrier: AT&T
Posts: 82
Default COLOR reference by string

Please Login to Remove!

Ok, so my java skill is lacking in a technique to do this.

I want to be able to use a string to represent a color, and to use that string to find the color integer value in the COLOR class.

IE. Where I would do...
graphics.setBackgroundColor(Color.SKYBLUE);

I want to find the INT color value from COLOR using a string value "SKYBLUE"

Since the colors are constants that represent integers, is there a way to find which constant equals a string value and then take its integer value?

Thanks,
Eric
Offline