Comment

Comment by jbverschoor

Well, the gradient is specified as an RGB gradient, yet the post talks about brightness. That's not the right comparison. There are different color models, and a gradient will simply interpolate between the values.

A better example would be to use HSL or LAB for the gradients (Red->Green):

  background: linear-gradient(to right, hsl(0, 100%, 50%), hsl(120, 100%, 50%));

  background: linear-gradient(to right, lab(50% 128 128), lab(50% -128 128));
  background: linear-gradient(to right, lab(50% 128 128), lab(100% -128 128));
The two different LAB values for "green" show that if you're just changing Lightness, you'll get a darker share of green. The RGB green needs 100% Lightness.

HSL produces the same output as an RGB gradient, which is wrong, as only L should be modified.

LAB works only in safari, and although the result is slightly different, it's still incorrect, probably due to my conversion

parent jbverschoor 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton