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

Question regarding hexadecimal codes?

Hi again! :D

Actually I just noted that the hexadecimal base system is that of a 16-base system Which means: 0 1 2 3 4 5 6 7 8 9 a b c d e f

So 0 is black and f is white and anything in between is different colors.

What if you want to change the shade of a certain color? Or increase/decrease the saturation? (adding more whites/darks to the color) Can you guys please tell me how you would alter the code regarding making color/design choices and are there any exercises I can do to improve this skill as well or books I can read to develop a color mixing sense?

Kind of clueless about color mixing since I haven't done this sort of thing before.

How do you go about it? Didn't get the part where he talked about 1 number has 16-digits or something.

A bit confused. Please help?

2 Answers

Alejandro Byrne
Alejandro Byrne
2,562 Points

So, basically if you want to decrease/increase the darkness of a color, then you would decrease a few the numbers (preferably the middle 2). If you want to make it a little lighter, you can change the lighter color higher. The code goes #RRGGBB R = Red, G = Green, and B = Blue. So you can alter the numbers to whatever more or less you want. if you have any more questions, please ask me. :)

Alejandro Byrne
Alejandro Byrne
2,562 Points

A good way to get better is just to experiment with the colors and see which one you get more comfortable with. you should go to htmlcolorcodes.com

OMG! Thank You! That site is super helpful! I will just keep playing with the tints and shades to see how the codes change :D

Ok, I have another question. So basically, in the RGB values, the red, green and blue elements each have 256 shades of color which can be mixed to get various color combinations? While playing with the RGB slider I noticed sometimes the R element went up to 255 max.

Edit: That was a typo error sorry. It actually went to 255 :)

Actually, each value in RGB are supposed to go up to 255. I don't know why it got to 256...

Guil has said that rgb values go up to 255 when he was teaching the rgb function.

~Alex

Here's a grayscale from black to white:

#000000 /* absolutely black */
#111111 /* almost black */
#222222 /* a little bit lighter than before */
#333333 /* a little bit lighter than before */
#444444 /* very dark gray */
#555555 /* a little bit lighter than before */
#666666 /* a little bit lighter than before */
#777777 /* a little bit lighter than before */
#888888 /* darkish gray */
#999999 /* gray */
#aaaaaa /* light gray */
#bbbbbb /* a little bit lighter than before */
#cccccc /* a little bit lighter than before */
#dddddd /* very light gray */
#eeeeee /* almost white */
#ffffff /* completely white */

Also, as Alejandro said, it is great to experiment. Try the HTML color codes (I never tried it, but it sounds good. Thanks Alejandro for mentioning it :smile:). Experimenting is great to do in CSS.

I hope this helps. ~Alex