Working with Color

SVG's color handling is similar to HTML; many of the same terms and properties are shared between the two markup languages. Developers can designate color values through several methods. Two of the most common methods are: 1) using a color's name or 2) using a color's RGB hexadecimal value.

In the previous examples, you've used the first method by designating a color by its name. It's important to note, however, that not just any color name will work. A set of color keywords has been defined by the W3C and is viewable in the appendix of this book.

Color keywords are great for quick designation of a color. However, they are often not the precise color that a designer is looking for. Hexadecimal notation of color offers a greater ...

Get Sams Teach Yourself SVG in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.