04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

overview of web colors<br />

How do Web colors work?<br />

You’re starting to see that there are lots of places you can add color to your<br />

pages: background colors, border colors, and soon, font colors as well. But,<br />

how do colors on a computer actually work? Let’s take a look.<br />

100% Red 100% Blue<br />

364 Chapter 9<br />

100% Green<br />

60% Red 60% Blue<br />

60% Green<br />

Web colors are specified in terms of how<br />

much red, green, and blue make up the<br />

color. You specify the amount of each<br />

color from 0 to 100% and then add them<br />

all together to arrive at a final color. For<br />

instance if you add 100% red, 100% green,<br />

and 100% blue together, you get white.<br />

Notice that on a computer screen, mixing<br />

together colors results in a lighter color.<br />

After all, this is light we’re mixing!<br />

Here’s red, green and blue being<br />

mixed together. If you look at the<br />

center you’ll see how they all add up.<br />

But, if you add, say, only 60% of each<br />

component (red, green, and blue) then<br />

what would you expect? Less white,<br />

right? In other words, you get a gray<br />

color, because we’re sending equal<br />

amount of the three colors, but not as<br />

much light to the screen.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!