-
January 17th, 2001, 01:24 PM
#1
URGENT:: opposite color
I try to find out how to calculate the opposite color. For example, if white is given, black should be the output color.
-
January 17th, 2001, 01:45 PM
#2
Re: URGENT:: opposite color
There are probably numerous ways to define opposite color, but
here is one way ...
COLORREF original_color = RGB(100,300,50); // whatever you want it
//
// determine the opposite color
//
int opp_red = 255 - GetRValue(original_color);
int opp_green = 255 - GetGValue(original_color);
int opp_blue = 255 - GetBValue(original_color);
COLORREF oposite_color = RGB(opp_red,opp_green,opp_blue);
-
January 17th, 2001, 02:46 PM
#3
Re: URGENT:: opposite color
In that way, RGB(128, 128, 128) will return RGB(127,127,127). That is almost same color instead of opposite color. Do you have another way?
-
January 17th, 2001, 03:09 PM
#4
Re: URGENT:: opposite color
Not off hand ... I am not sure what the opposite of medium gray would even be. The opposite of light gray is dark gray. What do you think the opposite of medium gray should be ? I'll let you know if I can think of anything else.
-
January 17th, 2001, 03:25 PM
#5
Re: URGENT:: opposite color
The opposite of medium gray (128,128,128) is medium gray (127,127,127). Try it in MS Paint. It's analogous to finding the opposite of zero. Nothing is darker than black so it can't be the center point of inversion. The center point is medium grey (128,128,128).
mr. blonde
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|