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 trialOrkdomm Phlong
335 PointsI 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
7,825 PointsHex 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
Richard Duffy
16,488 PointsHello,
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!
Orkdomm Phlong
335 PointsThanks
Stephen Goeddel
11,239 PointsHexadecimal is base 16, Octal is base 8.
Eric Dietrich
Courses Plus Student 5,897 PointsSmashing 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.
Richard Duffy
16,488 PointsYou are most welcome!
Richard Duffy
16,488 PointsOh yeah sorry about that! I wondered why it went up to 16 __ :(.
Eric Dietrich
Courses Plus Student 5,897 PointsEric Dietrich
Courses Plus Student 5,897 PointsSemantically, #111111 is a shade of gray and and #000000 is technical black.