Browser color names support detecting
Brute-force approach to find out what color names are supported by your browser engine (code snippet available)
Start!


Results:
None yet.
Most browsers support various color definition formats: RGB hex codes (e.g. #00FF00), direct RGB or HSL component values (rgb(0, 255, 0)), and also color names, which can be used by HTML, CSS, JS and other markup/scripting means. It is believed that there are 140 "main" colors that can be declared by name, e.g. "red", "white", "olive", "magenta" etc. But what if some browsers support more than that? It is possible to find out!

We can iterate over all possible letter combinations, assigning its value to HTML DOM element and then reading back its color value! That is, if our letter combination is not a valid color name, nothing will change, element color will be the same as before. But if it turns to be a valid color, then DOM element color will change and reading back will give its value.

Such brute-force operations consume a lot of CPU time, so your browser may occasionally freeze or show "Tab does not respond" warning. Sad but true. It is not a bug - that is, your browser is working hard to check every n-letter combination, one of 265 = 11881376 for string of 5 letters, or of 266 = 308915776 for string of 6 letters. So it takes some time, depending on your PC.
  • sourceShow/hide source