HTML Colors Hex values | SoloLearn: Learn to code for FREE!


HTML Colors Hex values

I do not get when the hashtag symbol (#) is followed by three hex characters? And when it is followed by six hex characters? I Also Would like to know if there is a specific rule for writing the Hex values?

4/6/2020 2:27:58 PM

Ibrahim Samir Jibril

3 Answers

New Answer


Hex are Red Green Blue For three digit, each single digit is for one color, from 0 to 15. For six digit, each two digit is for two color, from 0 to 255. You don't have to memorizes anything. Use an online HTML color picker, or the color picker built-in in a code editor.


3 hex chars is a shorcut for 6 hex char with twice the same char at each color: #f00 == #ff0000 == red #9ac == #99aacc ...


I have a code which converts those values.