Color Spaces for Developers: Why Your Eyes Disagree With the Math
Try something. Open any design tool and create two colors: #FF0000 (pure red) and #00FF00 (pure green). Now look at them side by side. The green looks significantly brighter than the red, even thou...

Source: DEV Community
Try something. Open any design tool and create two colors: #FF0000 (pure red) and #00FF00 (pure green). Now look at them side by side. The green looks significantly brighter than the red, even though both have the exact same maximum value of 255 in their respective channels. The math says they're equal. Your eyes say otherwise. This is because human vision is not equally sensitive to all wavelengths of light. We perceive green as roughly twice as bright as red and nearly six times as bright as blue. The RGB color model doesn't account for this. It's a model of how screens emit light, not how humans perceive it. Understanding this disconnect is the key to making better color decisions in code. RGB is a hardware model RGB (Red, Green, Blue) maps directly to the three types of subpixels in your display. Each channel gets a value from 0 to 255 (in 8-bit color), and the screen mixes them additively. It's straightforward and it's how browsers render every color on screen. But "straightforwar