Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS How to Make a Website Customizing Colors and Fonts Use Color in CSS

I need help understanding the Hexadecimal rule.

does each number represent a color? how does a programmer memorize all these complicated codes?

5 Answers

Clinton Hopgood
Clinton Hopgood
7,825 Points

Hex color codes are made up of 3 sets of 2 numbers. Each set representing Red, Green and Blue in that order

ff(red)ff(green)ff(blue)

The spectrum goes as follows starting with black and ending is white.

1 2 3 4 5 6 7 8 9 A B C D E F

E.g. #111111 = black #ffffff = white

Semantically, #111111 is a shade of gray and and #000000 is technical black.

Hello,

Each number represents a different colour. Hexadecimal is in Base 8 so if goes like this:

1 2 3 4 5 6 7 8 9 A B C D E F

Here is a good example:

http://www.binaryhexconverter.com/hex-to-decimal-converter

Also no programmer memorises all of the different colour codes, I look them up on http://color.hailpixel.com/ or http://flatuicolors.com . I do however remember some of them off hand like #000 #FFF #CCC #F0F0F0.

I hope this helps!

Thanks

Hexadecimal is base 16, Octal is base 8.

Smashing Magazine has an excellent piece on this.

As the article says, there are: 16,777,216 varieties of "color" when using Hex.

I just remember that 00 is the least amount of the corresponding Red Green or Blue and that FF is as much of that color as possible. A lot of Hex memorization just comes from using codes...basically osmosis.

You are most welcome!

Oh yeah sorry about that! I wondered why it went up to 16 __ :(.