Color Space Basics
You'll learn what color spaces are and why sRGB is the web's default assumption.
What Is a Color Space?
A color space is like a defined palette that determines which colors can be represented and how they're measured. Think of it like the difference between a box of 24 crayons versus a professional artist's set of 120 colors—both can draw pictures, but one has a much wider range of available colors.
When you use color functions like rgb(), hsl(), or hex values in CSS, browsers assume you're working in the sRGB color space (standard Red-Green-Blue). This has been the web's default since its beginning.
Why Does This Matter?
sRGB was designed for older computer monitors and covers a relatively limited range of colors that human eyes can actually see. Modern screens can display far more vivid, saturated colors—but by default, CSS colors are confined to sRGB's smaller gamut (range).
When you write:
color: rgb(255, 0, 0);
The browser interprets those numbers as sRGB values. You're getting "sRGB red," not the most vibrant red your screen can physically produce.
The Limitation
sRGB cannot represent deeply saturated colors like the brilliant blues and greens you see in modern photography or high-end displays. If you've ever noticed colors looking "dull" compared to native apps or photos, this is often why—you're limited to the sRGB box of crayons.
Key Takeaway: By default, browsers interpret all CSS colors (hex, rgb(), hsl()) as sRGB values, which covers only a limited range of colors compared to what modern screens can display.