I've always been curious to know what happens in a 3-digit hexadecimal expression of a color in CSS.
For example, you have
000000 , which is the color black. And
ffffff which is white. There are also other colors which is
F00 which is red.
But there remains a curiosity:
How would I translate this 3-digit hex color to 6-digit hex color?
Do you have any formula to transform color hexadecimal from 3 to 6?
The 3-digit hex colors are expanded by doubling each character (see w3 spec ).
#F3A code is transformed to
Translated from https://stackoverflow.com/a/10230746/5230740 .