Find the nearest color in the historical 216-color cube
Admin ·
The browser-safe palette was a fixed set for older indexed-color displays. Use this reference to reproduce a constrained historical palette or inspect how an RGB value changes when snapped to it.
Round #5B88C7 to its closest web-safe match
Enter #5B88C7 in Color to compare. Its three RGB bytes are 91, 136 and 199. The tool rounds them to 102, 153 and 204, giving #6699CC. The displayed channel changes are +11, +17 and +5.
Enter #6699CC to confirm an exact match. A short HEX value like #369 produces the same RGB bytes as #336699, so it is also exact when entered in the tool.
W3C, Dave Raggett — browser-safe color levelsCSS Color Level 4 — sRGB colors
Export the 36 swatches with red set to 102
Return to #5B88C7 and select Show matching red level. The chart now shows 36 of 216 colors. Green and blue still take all six levels, while red is fixed at 102.
Download visible colors CSV and open it as a table. It contains a header and 36 data rows. The first color is #660000 and the final color is #66FFFF. Select All red levels to export the entire cube.
Use the historical palette when the project needs it
The historical palette uses the byte levels 00, 33, 66, 99, CC and FF in hexadecimal. The 216 combinations reflect a display constraint from early browsers. Modern CSS can represent sRGB values between those levels.
The RGB snap measures byte distances. To plan text colors, check the actual text and background pair in Contrast Checker.
W3C, Dave Raggett — browser-safe color levelsCSS Color Level 4 — sRGB colors
Common questions
What do the signed channel changes mean?
Each change is the matched palette byte minus the input byte. A positive change means that channel increased.
Can I use an HSL color as input?
Yes. The tool first converts the HSL value to 8-bit sRGB, then compares the three RGB bytes with the pattern in the historical palette.
Do all web-safe colors have CSS names?
No. The palette is defined by numeric RGB components. A subset happens to share values with CSS named colors.
Sources
Put it into practice.
- Web Safe Colors Reference
- CSS Color Format Converter
- Color Palette Generator
- Color Wheel Generator
- Contrast checker