Color Codes Reference
Color codes reference: common CSS named colors mapped to HEX and RGB values, with swatch previews for quick selection in frontend styles.
How It Works
The same color can be written several ways. HEX (e.g. #ff8000) is just RGB in hexadecimal; RGB describes it with three 0–255 channels (red/green/blue); HSL uses hue (0–360°), saturation and lightness, which matches human intuition and makes tweaking easier.
They convert to one another; the choice is contextual — CSS leans on HEX and RGB, theming and gradients prefer HSL. Transparency is expressed with RGBA/HSLA or 8-digit HEX (#rrggbbaa) for the alpha channel.
| Swatch | Name | HEX | RGB |
|---|---|---|---|
| Black | #000000 | rgb(0, 0, 0) | |
| White | #FFFFFF | rgb(255, 255, 255) | |
| Red | #FF0000 | rgb(255, 0, 0) | |
| Green | #008000 | rgb(0, 128, 0) | |
| Lime | #00FF00 | rgb(0, 255, 0) | |
| Blue | #0000FF | rgb(0, 0, 255) | |
| Yellow | #FFFF00 | rgb(255, 255, 0) | |
| Cyan | #00FFFF | rgb(0, 255, 255) | |
| Magenta | #FF00FF | rgb(255, 0, 255) | |
| Gray | #808080 | rgb(128, 128, 128) | |
| Silver | #C0C0C0 | rgb(192, 192, 192) | |
| Maroon | #800000 | rgb(128, 0, 0) | |
| Olive | #808000 | rgb(128, 128, 0) | |
| Navy | #000080 | rgb(0, 0, 128) | |
| Teal | #008080 | rgb(0, 128, 128) | |
| Purple | #800080 | rgb(128, 0, 128) | |
| Orange | #FFA500 | rgb(255, 165, 0) | |
| Pink | #FFC0CB | rgb(255, 192, 203) | |
| Brown | #A52A2A | rgb(165, 42, 42) | |
| Gold | #FFD700 | rgb(255, 215, 0) | |
| Tomato | #FF6347 | rgb(255, 99, 71) | |
| Crimson | #DC143C | rgb(220, 20, 60) | |
| SteelBlue | #4682B4 | rgb(70, 130, 180) | |
| DodgerBlue | #1E90FF | rgb(30, 144, 255) | |
| ForestGreen | #228B22 | rgb(34, 139, 34) | |
| HotPink | #FF69B4 | rgb(255, 105, 180) | |
| Indigo | #4B0082 | rgb(75, 0, 130) | |
| Violet | #EE82EE | rgb(238, 130, 238) | |
| Chocolate | #D2691E | rgb(210, 105, 30) | |
| Salmon | #FA8072 | rgb(250, 128, 114) | |
| SkyBlue | #87CEEB | rgb(135, 206, 235) | |
| SlateGray | #708090 | rgb(112, 128, 144) | |
| LightGray | #D3D3D3 | rgb(211, 211, 211) | |
| DarkSlateGray | #2F4F4F | rgb(47, 79, 79) | |
| Coral | #FF7F50 | rgb(255, 127, 80) | |
| Turquoise | #40E0D0 | rgb(64, 224, 208) | |
| Khaki | #F0E68C | rgb(240, 230, 140) | |
| Plum | #DDA0DD | rgb(221, 160, 221) |
Frequently Asked Questions
What is the difference between HEX and RGB?
They represent the same color. HEX is hexadecimal (e.g. #FF0000); RGB is a decimal function (rgb(255,0,0)). Modern CSS also supports rgb(255 0 0 / 0.5) alpha and #RRGGBBAA.
What are web-safe colors?
Early displays could only reliably show a 216-color palette. It is no longer necessary, but classic named colors like red/blue/green remain the most used.
How do I ensure accessible color contrast?
Aim for text/background contrast ≥ 4.5:1 (WCAG AA). Do not judge by named color alone; use a contrast checker.
How many named CSS colors are there?
The CSS spec defines 148 named colors (including transparent and currentColor). This table lists the most common basic and extended colors.