What’s in a name [of css color]?

While editing my site I found that there is a bit of conflict in color naming between CSS standard and the actual use of color names on the Web. Only 16 colors names are listed in official CSS specs, but actually more names are in use. Which brings a question: are you satisfied with 16 official CSS names and are you ready to resort to hex numbers (since we squiggle names like CadetBlue or Gainsboro in stylesheets) or do you want us to provide an option to relax validation and allow named colors which seem to be supported by IE as well as by Mozilla? We already allow them if target is IE6. Or will it be really wrong thing to do ?

Comments (7)

  1. mike says:

    What we really ought to do is track down whoever came up with those names in the first place and give that them a good thrashing. "Gainsboro"? What the heck is that? 🙂

  2. Jerry Pisk says:

    It was W3C SVG working group who came up with those names (well, they probably just took them from somewhere else anyways). See CSS3, http://www.w3.org/TR/2003/CR-css3-color-20030514/#svg-color – the names come from SVG standard and as of level 3 they’re supported in CSS.

    To answer Mikhail’s question – all those other names are official too, in CSS3 they are. So it depends, I would personally go with standards here.

  3. Tommi says:

    I think the whole idea of "named colors" should be dropped for now. In my eyes it’s just an old relic from the times when computers only supported 16 or so colors.

  4. Mikhail Arkhipov (MSFT) says:

    Names are usefule, IMHO since it is easier to remember name than a hex code 🙂

  5. josh says:

    CSS should allow user-defined constants, so you can give a name to your favorite color and use it in several places without resorting to hex. That has the additional benefit of making it easier to change color schemes, since you can keep all the colors in one place. (of course you can do that to a limited degree anyway, but not as nicely)

  6. I vote for dropping them. The squiggly (or lack thereof) indicates the adherence to standard. Just because IE and Mozilla deviate in a similar fashion does not a standard make. I also find the names useless, btw. They are arbitrary enough that it is just as easy to remember hex values.

  7. >> Names are usefule,

    >> IMHO since it is easier to remember name

    >> than a hex code 🙂

    IMHO, it is a common mistake – it is easier to remember number than color (of course except colors like black and white). Even black and white are easy: #000000 and #ffffff. All the others are tricky, if you don’t remember the number. Nevertheless colors in web are easy to remeber in numbers. If you see MSN colors, for example they are: #336699, #336666, #666699, etc.

    Another useful feature in web:

    if the color is #abcdef, in order to be displayed in web the same and not be dependent on monitor color depth (css recomendations), the rule is:

    a=b, c=d, e=f

Skip to main content