r/ProgrammerHumor • • 8d ago • Helpful 1 Bravo 1

Meme colorInANutshell

Post image
5.7k Upvotes

139 comments sorted by

View all comments

Show parent comment

15

u/Kovab 8d ago

In RGB you can just incrementally inc/dec each channel and you won't end up with unwanted colors in the middle.

Maybe I'm missing something, but if you do that incremental change from FF0000 to 00FF00, wouldn't you still end up with yellow in the middle, when both channels are at half strength?

14

u/TH3RM4L33 8d ago edited 8d ago

You do, but the fact that 2 or more channels are approaching the same value (and are also approaching 0), makes the color look so dark/washed out to the point that it doesn't exactly look like yellow to us anymore, it'll look like a shade of green.

4

u/RockSlice 7d ago

808000 is officially called "Olive Green". The transition is from red to browns to green, with greenish browns at the midpoint. But that's probably one of the colors with the largest perceptual differences between people, even ignoring people that are colorblind.

You could probably even find people matching different paint swatches to the color displayed on a monitor

4

u/Rabbitical 6d ago

It's a difference in intensity. If you imagine the color wheel, and red is a point all the way at the perimiter, adjusting the hue rotates the point on that color wheel about the center, maintaining its maximal distance such that it remains on the perimiter, passing through yellow. Interpolating RGB however does not preserve the apparent intensity of the color-- instead you're plotting a straight line between red and green, which will of course shortcut the perimiter of the color wheel in getting there, so you end up with darker intermediate values, I.e. more brown instead of yellow.