Códigos de color
Color Codes is the full list of the 148 colour names CSS understands, each with its hex, RGB and HSL code and its contrast against white and black. Search by name or paste a hex value to find out what a colour is called, filter by family, and sort by hue or lightness to see the whole set arranged the way the eye reads it rather than alphabetically.
La interfaz de esta herramienta está en inglés.
148 of 148 colours
| Colour | Name | HEX | RGB | HSL | On white | On black |
|---|---|---|---|---|---|---|
| aliceblue | 1.07 | 19.58 | ||||
| antiquewhite | 1.17 | 17.93 | ||||
| aqua | 1.25 | 16.75 | ||||
| aquamarine | 1.22 | 17.16 | ||||
| azure | 1.03 | 20.45 | ||||
| beige | 1.11 | 18.98 | ||||
| bisque | 1.22 | 17.15 | ||||
| black | 21.00 | 1.00 | ||||
| blanchedalmond | 1.17 | 18.02 | ||||
| blue | 8.59 | 2.44 | ||||
| blueviolet | 5.96 | 3.52 | ||||
| brown | 7.08 | 2.96 | ||||
| burlywood | 1.86 | 11.31 | ||||
| cadetblue | 3.05 | 6.88 | ||||
| chartreuse | 1.30 | 16.21 | ||||
| chocolate | 3.63 | 5.78 | ||||
| coral | 2.50 | 8.40 | ||||
| cornflowerblue | 2.97 | 7.06 | ||||
| cornsilk | 1.07 | 19.71 | ||||
| crimson | 4.99 | 4.21 | ||||
| cyan | 1.25 | 16.75 | ||||
| darkblue | 15.30 | 1.37 | ||||
| darkcyan | 4.15 | 5.07 | ||||
| darkgoldenrod | 3.25 | 6.45 | ||||
| darkgray | 2.35 | 8.94 | ||||
| darkgreen | 7.44 | 2.82 | ||||
| darkgrey | 2.35 | 8.94 | ||||
| darkkhaki | 2.07 | 10.15 | ||||
| darkmagenta | 8.50 | 2.47 | ||||
| darkolivegreen | 5.95 | 3.53 | ||||
| darkorange | 2.33 | 9.00 | ||||
| darkorchid | 5.70 | 3.68 | ||||
| darkred | 10.01 | 2.10 | ||||
| darksalmon | 2.31 | 9.11 | ||||
| darkseagreen | 2.15 | 9.76 | ||||
| darkslateblue | 9.07 | 2.32 | ||||
| darkslategray | 8.93 | 2.35 | ||||
| darkslategrey | 8.93 | 2.35 | ||||
| darkturquoise | 1.95 | 10.75 | ||||
| darkviolet | 6.56 | 3.20 | ||||
| deeppink | 3.64 | 5.77 | ||||
| deepskyblue | 2.12 | 9.90 | ||||
| dimgray | 5.49 | 3.83 | ||||
| dimgrey | 5.49 | 3.83 | ||||
| dodgerblue | 3.24 | 6.49 | ||||
| firebrick | 6.68 | 3.14 | ||||
| floralwhite | 1.04 | 20.18 | ||||
| forestgreen | 4.39 | 4.78 | ||||
| fuchsia | 3.14 | 6.70 | ||||
| gainsboro | 1.37 | 15.31 | ||||
| ghostwhite | 1.06 | 19.86 | ||||
| gold | 1.40 | 14.97 | ||||
| goldenrod | 2.24 | 9.38 | ||||
| gray | 3.95 | 5.32 | ||||
| green | 5.14 | 4.09 | ||||
| greenyellow | 1.23 | 17.12 | ||||
| grey | 3.95 | 5.32 | ||||
| honeydew | 1.04 | 20.27 | ||||
| hotpink | 2.65 | 7.93 | ||||
| indianred | 3.98 | 5.28 | ||||
| indigo | 12.95 | 1.62 | ||||
| ivory | 1.01 | 20.81 | ||||
| khaki | 1.28 | 16.40 | ||||
| lavender | 1.23 | 17.06 | ||||
| lavenderblush | 1.10 | 19.03 | ||||
| lawngreen | 1.33 | 15.78 | ||||
| lemonchiffon | 1.06 | 19.81 | ||||
| lightblue | 1.53 | 13.74 | ||||
| lightcoral | 2.59 | 8.10 | ||||
| lightcyan | 1.05 | 19.92 | ||||
| lightgoldenrodyellow | 1.07 | 19.67 | ||||
| lightgray | 1.50 | 14.03 | ||||
| lightgreen | 1.42 | 14.82 | ||||
| lightgrey | 1.50 | 14.03 | ||||
| lightpink | 1.65 | 12.71 | ||||
| lightsalmon | 1.99 | 10.56 | ||||
| lightseagreen | 2.62 | 8.01 | ||||
| lightskyblue | 1.72 | 12.24 | ||||
| lightslategray | 3.64 | 5.77 | ||||
| lightslategrey | 3.64 | 5.77 | ||||
| lightsteelblue | 1.78 | 11.80 | ||||
| lightyellow | 1.02 | 20.63 | ||||
| lime | 1.37 | 15.30 | ||||
| limegreen | 2.12 | 9.91 | ||||
| linen | 1.12 | 18.67 | ||||
| magenta | 3.14 | 6.70 | ||||
| maroon | 10.95 | 1.92 | ||||
| mediumaquamarine | 1.93 | 10.88 | ||||
| mediumblue | 11.16 | 1.88 | ||||
| mediumorchid | 3.94 | 5.33 | ||||
| mediumpurple | 3.76 | 5.58 | ||||
| mediumseagreen | 2.67 | 7.88 | ||||
| mediumslateblue | 4.15 | 5.06 | ||||
| mediumspringgreen | 1.39 | 15.14 | ||||
| mediumturquoise | 1.86 | 11.27 | ||||
| mediumvioletred | 5.42 | 3.87 | ||||
| midnightblue | 14.85 | 1.41 | ||||
| mintcream | 1.02 | 20.57 | ||||
| mistyrose | 1.20 | 17.44 | ||||
| moccasin | 1.23 | 17.02 | ||||
| navajowhite | 1.29 | 16.30 | ||||
| navy | 16.01 | 1.31 | ||||
| oldlace | 1.08 | 19.38 | ||||
| olive | 4.20 | 5.01 | ||||
| olivedrab | 3.81 | 5.52 | ||||
| orange | 1.97 | 10.63 | ||||
| orangered | 3.44 | 6.10 | ||||
| orchid | 2.89 | 7.27 | ||||
| palegoldenrod | 1.25 | 16.76 | ||||
| palegreen | 1.27 | 16.59 | ||||
| paleturquoise | 1.29 | 16.29 | ||||
| palevioletred | 3.11 | 6.75 | ||||
| papayawhip | 1.13 | 18.56 | ||||
| peachpuff | 1.31 | 15.98 | ||||
| peru | 2.99 | 7.02 | ||||
| pink | 1.54 | 13.65 | ||||
| plum | 2.07 | 10.15 | ||||
| powderblue | 1.43 | 14.65 | ||||
| purple | 9.42 | 2.23 | ||||
| rebeccapurple | 8.41 | 2.50 | ||||
| red | 4.00 | 5.25 | ||||
| rosybrown | 2.81 | 7.46 | ||||
| royalblue | 4.85 | 4.33 | ||||
| saddlebrown | 7.10 | 2.96 | ||||
| salmon | 2.50 | 8.40 | ||||
| sandybrown | 2.03 | 10.33 | ||||
| seagreen | 4.25 | 4.95 | ||||
| seashell | 1.07 | 19.55 | ||||
| sienna | 5.62 | 3.74 | ||||
| silver | 1.82 | 11.54 | ||||
| skyblue | 1.74 | 12.06 | ||||
| slateblue | 5.31 | 3.96 | ||||
| slategray | 4.05 | 5.18 | ||||
| slategrey | 4.05 | 5.18 | ||||
| snow | 1.03 | 20.31 | ||||
| springgreen | 1.35 | 15.61 | ||||
| steelblue | 4.11 | 5.11 | ||||
| tan | 1.97 | 10.65 | ||||
| teal | 4.77 | 4.40 | ||||
| thistle | 1.70 | 12.36 | ||||
| tomato | 2.95 | 7.13 | ||||
| turquoise | 1.64 | 12.79 | ||||
| violet | 2.32 | 9.06 | ||||
| wheat | 1.31 | 15.98 | ||||
| white | 1.00 | 21.00 | ||||
| whitesmoke | 1.09 | 19.26 | ||||
| yellow | 1.07 | 19.56 | ||||
| yellowgreen | 1.88 | 11.15 |
La guía de abajo solo está disponible en inglés.
How does Color Codes work?
CSS has 148 colour keywords. They are not a system — they accumulated. Sixteen came from the original HTML 4 palette, which came from the VGA sixteen. Another 130 arrived from the X11 window system’s rgb.txt, a file assembled at MIT over the 1980s by people naming colours as they needed them. That is why there is both gray and grey, why darkgray is lighter than gray, and why rebeccapurple — added in 2014 in memory of Eric Meyer’s daughter — is the only one with a story.
Why darkgray is lighter than gray
gray is #808080, the midpoint of the HTML 4 palette. darkgray is #a9a9a9, which is lighter. They came from different sources and were never reconciled, because by the time anyone noticed, changing either would have broken every page using it. It is the most reliable way to catch a colour tool that generated its table rather than reading the spec.
Sorting by hue rather than by name
Alphabetical order is useless for choosing a colour and perfect for finding one you can already name. Sorting by hue puts the list in the order the eye expects — the reds together, then the oranges, and so on round the wheel — which is the view that answers “what else is near this?”. The hue used is the OKLCh angle, not the HSL one, so the groupings match what the colours look like rather than what the arithmetic says.
The contrast columns
Each row carries its WCAG 2.x ratio against white and against black. That is the number that decides whether the colour can hold text, and it is the fastest way to rule out most of this list for anything other than decoration: of the 148, fewer than half reach 4.5:1 on white.
A name, or a hex value
navy
Every code for it
hex #000080 rgb rgb(0 0 128) hsl hsl(240 100% 25.1%) on white 15.30 : 1 on black 1.37 : 1
What options and edge cases does Color Codes support?
| Parameter | Type | Default | Behaviour & edge cases |
|---|---|---|---|
| 148 | count | CSS Color 4 | The number of named colours, counting the greys spelled both ways as separate keywords. 147 is the figure usually quoted, from before rebeccapurple was added. |
| gray / grey | alias | both valid | Every grey keyword exists in both spellings and they are identical values. CSS accepts either, and always has. |
| darkgray | #a9a9a9 | — | Lighter than gray (#808080). An artefact of merging the HTML 4 and X11 palettes, preserved because changing it would break existing pages. |
| rebeccapurple | #663399 | 2014 | The only keyword added since the X11 import, in memory of Rebecca Meyer. An alias of the value her father used for it. |
| aqua / cyan | #00ffff | identical | Same value, two names, as are fuchsia and magenta. Both pairs survive from the two source palettes. |
| transparent | keyword | rgba(0,0,0,0) | Valid wherever a colour is, and not in this list because it has no value to look up. |
| Contrast | ratio | vs #fff / #000 | WCAG 2.x ratio. 4.5:1 is the minimum for normal text; fewer than half of these keywords reach it on white. |
| Hue sort | OKLCh | degrees | Sorted by perceptual hue angle, not HSL — which is why red lands at 29° here rather than 0°. |
Frequently asked questions
What is the hex code for red?
#FF0000, which is rgb(255 0 0) and hsl(0 100% 50%). It is one of the original sixteen HTML 4 keywords. Worth knowing: pure #FF0000 is a very saturated red that vibrates against white and is hard to read as text — it reaches only 4.0:1 on white, which fails WCAG AA for body copy. Most interfaces want something closer to #C62828 or darker.
What is the hex code for navy blue?
#000080. That is the CSS keyword navy: rgb(0 0 128), exactly half-intensity blue. It is very dark — 15.3:1 against white — which makes it excellent for text on a light background and nearly unreadable on a dark one. The lighter navy used in most brand palettes is usually around #1B3A6B rather than the keyword.
Why is darkgray lighter than gray?
Because they came from different places. gray is #808080 from the HTML 4 palette; darkgray is #A9A9A9 from X11's rgb.txt. When CSS merged the two lists in the late 1990s, the conflict was already shipped in browsers, so it was preserved rather than fixed. It is the single best test of whether a colour reference was copied from the spec or generated by somebody's assumption.
How many CSS colour names are there?
148 keywords, or 140 distinct colour values — the difference is the greys spelled two ways and the aqua/cyan and fuchsia/magenta pairs. The figure 147 that circulates predates rebeccapurple, which was added to the specification in 2014.
Can I use a colour name instead of a hex code in CSS?
Yes, anywhere a colour is valid, and every browser has supported all of them for two decades. The practical argument against is that the names are not a system: there is no relationship between darkblue and blue that you can rely on, no consistent lightness scale, and nothing to interpolate along. For a design system you want values you generated; for a quick prototype or a debug outline, `outline: 2px solid hotpink` is faster to type than any hex.
How do I find out what a hex colour is called?
Paste it into the search box. The filter matches hex values as well as names, so entering #4169e1 finds royalblue. If the value is not an exact keyword match nothing comes back — these are exact values, not nearest neighbours, and a tool that told you #4169e2 was 'royalblue' would be lying about a value you are about to paste into code.
Which related tools should I use next?
- Elegir colorElige un color y léelo en HEX, RGB, HSL, OKLCH o CMYK
- Comprobar contrasteComprueba texto y fondo contra WCAG 2.2 y da el color que pasa
- Test de daltonismoHaz un test de daltonismo y simula cómo ve las imágenes quien lo tiene
- Convertir coloresConvierte entre HEX, RGB, HSL, HSV, OKLCH y CMYK en ambos sentidos