Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

9. Styling with Fonts and Colors: Expand... > The two minute guide to hex codes

The two minute guide to hex codes

The first thing you need to know about hex codes is that they aren’t based on ten digits (0 to 9) – they’re based on 16 digits (0 to F). Here’s how hex digits work:

image with no caption

So if you see a hex number like B, you know that just means 11. But, what does BB, or E1, or FF mean? Let’s disassemble a hex color and see what it actually represents. In fact, here’s how you can do that for any hex color you might encounter.

Step one:

  • Separate the hex color into its three components.

    Remember that each hex color is made up of a red, green and blue component. The first thing you want to do is separate those.

    image with no caption

Step two:

  • Convert each hex number into its decimal equivalent.

    Now that you have the components separated you can compute the value for each from 0 to 255. Let’s start with the hex number for the red component:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial