Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Comparing colors?

843789Mar 23 2009 — edited Mar 23 2009
I'm trying to figure out how I can grab the color of an object and compare it with a given color value.

Something like:
if(page.getColor() == r=51,g=51,b=51) {
do this..
}

where 'page' is a variable argument type of Graphics.

How do I do this?

Currently I have a shape that when I do try this:
System.out.println(page.getColor());

this is the value that is written: r=51,g=51,b=51
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 20 2009
Added on Mar 23 2009
15 comments
370 views