#### Archived

This topic is now archived and is closed to further replies.

# finding complementary colors?

This topic is 6174 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Color theory question... Is there a formula for finding complementary colors in numeric RGB color space? Specifically, 24-bit RGB color. I have this color wheel... and it is laid out where complementary colors are opposite each other. It''s handy for finding a good color scheme for web pages, etc. But how do I determine what these colors are numerically? For instance, say I have the color value #FFA055 that I like a lot (no idea what that is)... is there a way to easily determine its compliment? Also on the wheel it has "split complementary" lines... but those don''t look quite so good.

##### Share on other sites
The color #FFA055 is an RGB specification. Break it into 3 sets of 2 digits each and you get the red, green and blue color components:
R  G  BFF A0 55

The numbers are specified in hexadecimal (each digit ranges from 0 - 15, where numbers greater than 9 are represented by the letters A - F; ie A = 10, E = 14, etc). So 'FF' = (15x16 + 15) = 255. 'A0' = 160 and '55' = 85. The individual Red, Green and Blue components can range from 0 - 255 in monitors or 0 - 1 in colorspace. The complement in colorspace is "the other end of the cube". ie ^RGB = (1 - R),(1 - G),(1 - B).
R_c = R / 255 = 1B_c = B / 255 = 160/255G_c = G / 255 = 85/255^R_c = 1 - R_c = 0^B_c = 1 - B_c = 95/255^G_c = 1 - G_c = 170/255^R = ^R_c * 255 = 0^B = ^B_c * 255 = 95^G = ^G_c * 255 = 170

So your complement/inverse is (0,95,170) or #0065AA. Note that you can omit the color space calculations and do the inverse as ^R = 255 - R, and so on.

EDIT: My bad, I thought you were looking for the inverse. Color complements are more complex, and I don't know if there's a formula for them but I'll check.

Edited by - Oluseyi on September 22, 2001 7:04:08 PM

1. 1
2. 2
3. 3
4. 4
frob
14
5. 5

• 16
• 12
• 20
• 12
• 19
• ### Forum Statistics

• Total Topics
632168
• Total Posts
3004529

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!