2

Due to this question I need to find the color codes for green, red and yellow so I can translate them into the decimal number used by the rgba() function. From this site I think green is #008000 which would be rgb(0, 128, 0). But I'd be interested in finding the official source. They didn't appear to be in the CSS spec. Any ideas where they would be?

Community
  • 1
  • 1
AJP
  • 26,547
  • 23
  • 88
  • 127

3 Answers3

5

They can be found in CSS <color> definition:

The list of color keywords is: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, and yellow

CSS named colors

Community
  • 1
  • 1
2

You'll find this site useful https://qhmit.com/css/css_color_codes.cfm

The following table contains the color names that are recognized by most, if not all, modern browsers. Most of these are from the list of X11 color names distributed with the X Window System. These color names were standardized by SVG 1.0.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
Kane
  • 16,471
  • 11
  • 61
  • 86
2

Worth pointing out that the specification extends beyond the basic colour keywords referenced by @Tim Cooper and contains some of the more creative (or, rather, SVG spec names) like "aliceblue" and "    lightgoldenrodyellow"

http://www.w3.org/TR/2011/REC-css3-color-20110607/#svg-color

w3 docos contain both the color names and their synonimous hex and rgb values which you may find useful for your task

Oleg
  • 24,465
  • 8
  • 61
  • 91