AJP
AJP

Reputation: 28453

Where to find css color codes

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?

Upvotes: 2

Views: 3589

Answers (3)

Kane
Kane

Reputation: 16802

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.

Upvotes: 2

Oleg
Oleg

Reputation: 24988

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

Upvotes: 2

user142162
user142162

Reputation:

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

Upvotes: 5

Related Questions