Hacker News new | ask | show | jobs
by smitelli 597 days ago
16,781,312 is the answer I got too.

One hex digit (0-F) is four bits. Six hex digits is (46) 24 bits. 24 bits is (2^24) 16.7 million combinations.

It is also legal to use three-digit colors in CSS, where (e.g.) #28d expands to #2288dd. In that context there are (43) 12 bits expressing (2^12) 4,096 colors. None of the three-digit codes from this group produce the same URL in the previous group, although all of the colors drawn on the screen are the same. For OP's purposes, these URLs are added to the others.

If one were to want to blow it up further, it's also legal to have an eight-digit hex code, where the rightmost two digits encode 256 possible levels of transparency for each color. That produces ~4 billion combinations.