News for hackers. Stuff that matters.
Re:What are OKLCH colors? by layer8 on Monday August 25, 2025 @08:23AM (#45013072)
A good gradient is one that takes a perceptually uniform, and typically perceptually shortest, path. The OKLCH gradient isn't perceptual uniform and appears to take unnecessary detours through other hues.
Re:What are OKLCH colors? by cubefox on Monday August 25, 2025 @09:08AM (#45013444)
One could also argue that the detour through other hues is necessary in this case to avoid going through grey.
Re:What are OKLCH colors? by layer8 on Monday August 25, 2025 @09:25AM (#45013622)
Gray is arguably just another color, it’s not clear why you’d want to avoid it. How is going via red and yellow better than going via gray? Varying hue is often perceived as a larger change than varying saturation or lightness. A path going through several distinct hues is visually less uniform than one going through gray once.
Re:What are OKLCH colors? by brulard on Monday August 25, 2025 @11:00AM (#45014617)
Let's say you continuously change wavelength of a laser from blue (~480nm) to red (~630nm), you are going through green, not through gray. If in your use case going through gray makes sense, that's ok, there may be many paths from one to another colors.
Re:What are OKLCH colors? by Sharlin on Monday August 25, 2025 @12:03PM (#45015320)
In general people don't really think of color in terms of the spectral progression (or the hue wheel), and I don't think that most people intuitively expect a gradient between two colors to pass through another "unrelated" primary or secondary color. The point is somewhat moot though, given that such gradients (like yellow to blue or red to green) are very unnatural anyway.
Re:What are OKLCH colors? by runarberg on Monday August 25, 2025 @03:02PM (#45017636)
Honestly I suspect this is largely a non issue. I have never made a gradient that goes through more than 2 different color (by some vague measure of different) without adding an additional stop. If I wanted to go through yellow and green to get to blue, I would add a stop at yellow and another at green, and I suspect most developers would do the same.
Re:What are OKLCH colors? by gowld on Monday August 25, 2025 @03:36PM (#45018017)
It's funny and a bit sad because we just went througha decades-long effort to migrate away from jet/rainbow gradients to vik/batlow/bi-hue gradients, and now rainbow is forcing its way back.

https://theconversation.com/how-rainbow-colour-maps-can-dist...

https://www.poynter.org/archive/2013/why-rainbow-colors-aren...

Re:What are OKLCH colors? by itishappy on Monday August 25, 2025 @03:50PM (#45018195)
I disagree somewhat. Color mixing just isn't particularly intuitive. It's not the most intuitive to get a third hue, but that doesn't justify grey (which has an undefined hue). I do think most people are quite comfortable with the fact that between blue and yellow exists green, but is it a saturated green or a desaturated green? Additive and subtractive color mixing behave very differently here.
Re:What are OKLCH colors? by JKCalhoun on Monday August 25, 2025 @01:41PM (#45016520)
Shine a red and a green light near each other on a wall — what does the transition look like?
Re:What are OKLCH colors? by ZoomZoomZoom on Monday August 25, 2025 @02:21PM (#45017085)
There's no transition, this is color mixing, or overlay in case of light.
Re:What are OKLCH colors? by JKCalhoun on Monday August 25, 2025 @03:13PM (#45017746)
Is that not a transition through the color mixing (or overlay). I'm assuming the light sort of tails off as you leave the area of one color and head to the other (and the other color comes on with more intensity then).

I suppose that's different with light than some analog with pigments? (Two dabs of color set apart, a brush perhaps used to blend them as continuously as is possible.)

Re:What are OKLCH colors? by cubefox on Monday August 25, 2025 @08:16PM (#45020778)
Your light thought experiment would produce a color gradient via additive color mixing.

A magenta to green gradient would then go through white rather than grey. A subtractive magenta-green gradient would go through black. Not sure what physical setup would produce the latter gradient. But the standard RGB (or OKLAB) gradient goes through grey rather than white or black. This type of gradient is physically created by dithering: Dithering a gradient from magenta to green, by just using these two base colors, would produce a perceptual grey in the middle. This type of color mixing is otherwise better known as alpha blending.

Re:What are OKLCH colors? by the_af on Monday August 25, 2025 @09:36AM (#45013704)
Is gray perceived as "just another color" or where all colors go when desaturated? I assumed the latter, which would explain why to avoid it if one isn't playing with saturation.
Re:What are OKLCH colors? by layer8 on Monday August 25, 2025 @10:07AM (#45014020)
Think of fashion, of smartphone colors, pen and pencil colors and the like. Gray, white, black, are just color choices among all the available colors. A gray T-shirt isn’t a desaturated colored T-shirt. It’s its own color.
Re:What are OKLCH colors? by the_af on Monday August 25, 2025 @11:28AM (#45014920)
Oh, I understand what you say. But in color spaces, isn't gray the "sink" towards which desaturated colors shift? This would make it a location to avoid (unless you're purposefully desaturating).
Re:What are OKLCH colors? by cruffle_duffle on Monday August 25, 2025 @11:31AM (#45014949)
Color is weird like. Gray is “all the visible spectrum in equal proportions”, which is white… just less white than the whitest thing visible but more white than the darkest (blackest) thing visible.

It’s a “color” because it’s useful to describe such a thing. If you had monitor entirely filled with 50% white you’d call it white. Only by comparing it to something brighter do you call it gray. Brown is the same thing. In a dark room if you looked at a monitor filled with red and green pixels you’d call it orange. Only when you start adding in clues like whites and brighter colors would you call it brown.

Anyway, yes grey is a color. But it is not quite the same as other colors. Other colors occupy only parts of the visible electromagnetic spectrum. Whites are the whole thing.

There is actually several very good technology connections videos about this stuff. Color is very cool!

Re:What are OKLCH colors? by seba_dos1 on Monday August 25, 2025 @12:35PM (#45015707)
> Whites are the whole thing.

...with varying definitions of "whole". D65 white is almost blue when compared to A white. It stops being either “all the visible spectrum" or "in equal proportions” pretty quickly once you look closer at it.

Re:What are OKLCH colors? by itishappy on Monday August 25, 2025 @03:58PM (#45018273)
A grey shirt is a desaturated shirt. You cannot resaturate grey.

I think if you buy a tie-dye shirt or phone case and it comes out half grey, despite it being a valid color, most folks will be disappointed.

Re:What are OKLCH colors? by Dylan16807 on Monday August 25, 2025 @05:55PM (#45019549)
> A grey shirt is a desaturated shirt. You cannot resaturate grey.

Aren't these in direct conflict? If you can't resaturate it, that implies it's not desaturated.

> I think if you buy a tie-dye shirt or phone case and it comes out half grey, despite it being a valid color, most folks will be disappointed.

And if you buy a forest motif, people will be upset if it's pink. That's just doing a tie-dye wrong, not a rebuke of whether it's a color at all.

Re:What are OKLCH colors? by itishappy on Monday August 25, 2025 @06:24PM (#45019869)
> Aren't these in direct conflict? If you can't resaturate it, that implies it's not desaturated.

Kinda. There's a singularity in the math. The problem is that hue is defined as an angle and saturation is defined as distance from the center, but there's no consistent way to define a direction for the origin. Black and white have the same problem because they're also desaturated.

> And if you buy a forest motif, people will be upset if it's pink. That's just doing a tie-dye wrong, not a rebuke of whether it's a color at all.

I'm not arguing that it's not a color, just that it doesn't belong in all gradients!

Re:What are OKLCH colors? by Dylan16807 on Monday August 25, 2025 @06:32PM (#45019958)
Of course it doesn't belong in all gradients. It would only be in gradients that go from near-opposite colors. Or if you mean pure gray it would only be in gradients between exact opposite colors, and there are no good options for such a gradient.
Re:What are OKLCH colors? by itishappy on Monday August 25, 2025 @07:08PM (#45020281)
I mention tie-dye because it feels like a quintessential example of a color gradient. I think it's perfectly reasonable to ask for a blue and orange tie-dye shirt and perfectly reasonable to not want grey colors simply because they're on opposite sides. I could see white in between, I could even see black, or I could see purple and red or cyan and yellow. I don't think there's a universally right answer here!
Re:What are OKLCH colors? by Dylan16807 on Monday August 25, 2025 @07:11PM (#45020311)
Someone asking for those colors doesn't actually want a gradient with two anchor points. So yes there are many answers but because it's not a quintessential example of a gradient.
Re:What are OKLCH colors? by itishappy on Monday August 25, 2025 @08:11PM (#45020746)
> Someone asking for those colors doesn't actually want a gradient with two anchor points.

I thought the same until I googled "blue and orange tie-dye." I'll be honest, more white and black than I expected!

> So yes there are many answers but because it's not a quintessential example of a gradient.

We may have to agree to disagree that tie-dye isn't a quintessential example of a gradient. Would you argue that rainbows aren't either?

Re:What are OKLCH colors? by Dylan16807 on Monday August 25, 2025 @08:58PM (#45021043)
> I thought the same until I googled "blue and orange tie-dye." I'll be honest, more white and black than I expected!

Putting white or black in between adds another anchor point.

And looking more around examples of blue and orange tie dye, most aren't really gradients overall, they have big splotches of solid color with small gaps or overlaps in between, and at least half the time the gaps and overlaps don't even have a gradient inside them.

> We may have to agree to disagree that tie-dye isn't a quintessential example of a gradient. Would you argue that rainbows aren't either?

Hmm. How about this. I would say a rainbow is not a gradient between two colors, and the color space discussion is about a gradient between two colors. The exact border of "quintessential" is not something I really want to spend too much time on.

Re:What are OKLCH colors? by itishappy on Monday August 25, 2025 @09:43PM (#45021331)
In my mind a gradient is simply a smooth transition between colors with no universally agreed upon definition. The choice of specific curve through colorspace is rather arbitrary. It seems perfectly reasonable to want to include grey and perfectly reasonable to want to avoid it.
Re:What are OKLCH colors? by AnimalMuppet on Monday August 25, 2025 @11:45AM (#45015125)
It depends on how you think about your spread. If, as someone else said, you're trying to represent a tunable laser going from red to blue, going through gray is completely wrong. That is not what a laser will do, ever. It will always be a fully saturated color.

So, depending on what you're doing, you want different things. You may want to view your color space as an RGB cube, and go through gray. Or you may want to view your color space as something more like HLS or OKLCH, and not go through gray.

Re:What are OKLCH colors? by ghurtado on Monday August 25, 2025 @12:59PM (#45016009)
> Gray is arguably just another color

Only if you're working with additive color.

With substractive, grey is just a darker (or dimmer) white.

Re:What are OKLCH colors? by itishappy on Monday August 25, 2025 @03:44PM (#45018125)
It's an ugly color. Saturation makes stuff pop; this is often desirable. This is why I think it's important to have both polar (OKLCH) and rectilinear (Oklab) gradients.
Re:What are OKLCH colors? by cubefox on Monday August 25, 2025 @04:54PM (#45018860)
Let's say neither going through gray nor through two different hues looks particularly great. It's pick your poison.
Re:What are OKLCH colors? by DemocracyFTW2 on Tuesday August 26, 2025 @05:23AM (#45024190)
Gray is arguably not just another color; I don't know about English but in German you have 'bunte' and 'unbunte' colors; 'unbunte' colors are white, black, and the grays in between