Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Basics (2014) Understanding Values and Units Color Values

Tim Smith
Tim Smith
11,164 Points

Why do we use RGB? The primary colors are Red Yellow and Blue? Why use the secondary color green?

Sorry if this is off the topic of css. It is perhaps more a color theory question. :)

3 Answers

TJ Egan
TJ Egan
14,420 Points

There's a diference between additive colors (http://en.wikipedia.org/wiki/Additive_color) and substractive colors (http://en.wikipedia.org/wiki/Subtractive_color).

At additive colors, the more you add, the brighter, because they are emiting elements. This is why the day light is (more-or-less) white, since the Sun is emitting in almost all the visible wavelength spectrum.

At the other hand, with substractive colors the more you put the darker, because they are reflecting elements. This is why the black colors get hotter quickly, because it gets all the electromagnetic waves and reflects almost none.

Specifically to your question, it depends where you are working on. Traditionally, it have been used additive colors (RGB) because the canon for computer graphics was the computer monitor, and since it's a emiting element, it makes sense to use the same structure at the graphic card (the colors are showed without conversions), but if you are used to graphic arts and press, the logic is substractive colors (CMYK) as for example Photoshop (if configured) works, so really it doesn't matter what color group you use: the primary colors of one group are the secondary colors of the second one and viceversa.

-- http://stackoverflow.com/questions/6531536/why-rgb-and-not-ryb

Kevin Korte
Kevin Korte
28,148 Points

I'll just add that I agree that difference here is additive colors vs subtraction colors. When you're dealing with digital screens, you're dealing with additive colors. When you're dealing with print, you're dealing with subtractive colors.

It's why your computer monitor uses red, green, and blue light to create the colors on the screen, but your printer use cyan, magenta, and yellow (black too) ink to print that same website image.