04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

using a photo editor for web colors<br />

Putting it all together<br />

You’ve now got a few different ways to specify colors. Take our orange<br />

color that is made up of 80% red, 40% green, and 0% blue. In <strong>CSS</strong><br />

we could specify this color in any of these ways:<br />

body {<br />

}<br />

body {<br />

}<br />

body {<br />

}<br />

How to find Web colors<br />

372 Chapter 9<br />

background-color: rgb(80%, 40%, 0%);<br />

background-color: rgb(204, 102, 0);<br />

background-color: #cc6600;<br />

Specify by the percentage<br />

of red, green and blue.<br />

Specify the amount of red, green and<br />

blue on the scale 0-255.<br />

Specify using a compact hex code.<br />

The two most common ways to find Web colors are to use a color chart or an<br />

application like Photoshop Elements. You’ll also find a number of Web pages<br />

that allow you to choose Web colors and translate between rgb and hex codes.<br />

Let’s check out Photoshop Elements (most photo-editing applications offer the<br />

same functionality).<br />

Most photo-editing<br />

applications provide a Color<br />

Picker that allows you to<br />

visually choose your color<br />

by using one or more color<br />

spectrums.<br />

Color Pickers also<br />

allow you to select<br />

only “Web safe” colors.<br />

We’ll talk about this<br />

in a sec.<br />

80% Red 0% Blue<br />

40% Green<br />

Once you’ve picked<br />

a color, the Color<br />

Picker will show<br />

you the color as<br />

both rgb values and<br />

a hex code.

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

Saved successfully!

Ooh no, something went wrong!