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

Meme colorInANutshell

Post image
5.5k Upvotes

133 comments sorted by

View all comments

Show parent comment

49

u/TH3RM4L33 4d ago

Yeah transitions/overlaps between all possible 2 colors are impossible in HSV. For example you can't make a gradient between green and red, cause the hue slider will go through yellow and orange. In RGB you can just incrementally inc/dec each channel and you won't end up with unwanted colors in the middle.

15

u/Kovab 4d 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 4d ago edited 4d 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 4d 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 3d 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.

5

u/ScallionSmooth5925 4d ago

But it's not going to be a linear transition 

2

u/m_redditUser 4d ago

try oklch