1. Home
  2. Computing & Technology
  3. PHP / MySQL

PHP Hex Color Chart

By Angela Bradley, About.com

1 of 3

Understanding Hex Colors

Before we can generate a chart of colors we must first understand the basics of how colors work on the web. Anyone who's done a little web design knows that #000000 is black and #ffffff is white and the colors in between are created in this six digit fashion. What you may not fully understand is what these letters and numbers mean.

The first two digits of the number represent the red value of the color, the next two represent the green value, and the final two represent the blue value. All of the colors on our computer are represented using different combinations of these values.

So what's with the letters? Although as humans we usually work in a base 10 system of counting, when dealing with colors we work in a base 16 system. That means that 0-9 are represented the same, however 10-15 are represented as A-F before adding a second digit to a number.

Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Step By Steps
  5. Generate a PHP Chart of Hex Colors - PHP Web Color Chart

©2009 About.com, a part of The New York Times Company.

All rights reserved.