Understanding Color Spaces: sRGB, Display-P3, and Beyond
You'll learn what color spaces are and why modern displays can show colors that traditional web standards couldn't handle.
What Is a Color Space?
Think of a color space as a palette of available colors that a display or image format can produce. Just like a painter's palette has only certain colors available, digital displays can only show colors within their specific "color space."
The color gamut is the range of colors that palette contains. A wider gamut means more vibrant, saturated colors are possible.
Traditional Web: sRGB
For decades, the web relied exclusively on sRGB (standard RGB). This color space was standardized in the 1990s and matches what most basic monitors could display. When you write rgb(255, 0, 0) or #ff0000, you're using sRGB coordinates.
sRGB works, but it's limited—like having only 64 crayons when more vivid colors exist.
Modern Displays: Display-P3 and Beyond
Display-P3 is a wider color space that can display about 25% more colors than sRGB. Modern smartphones, tablets, and high-end monitors support it. This means richer greens, deeper reds, and more saturated colors.
CSS now lets you specify colors in these wider spaces:
.vibrant {
color: color(display-p3 1 0 0); /* More vivid red than sRGB */
}
Other emerging spaces include Rec2020 (even wider) and Lab/LCH (perceptually uniform color spaces).
Why This Matters
Users with modern displays can see richer, more accurate colors if you design for them. Those with older displays will see colors gracefully fall back to sRGB. Understanding color spaces helps you leverage modern hardware while maintaining compatibility.
Key Takeaway: Color spaces define the range of colors available; sRGB is the traditional web standard, while Display-P3 and beyond offer wider gamuts for more vibrant colors on modern displays.