Re: [css4-images] Non-linear interpolation between gradient color stops

On Wed, Jan 21, 2015 at 10:09 AM, Jonathan Rimmer <jon.rimmer@gmail.com> wrote:
> I am pretty sure it isn't. What the spec describes as non-linear
> interpolation appears to be the equivalent of Photoshop's mid-point
> adjustment. This is not the same as interpolation via a curve. It's a useful
> feature for making tweaks to gradient appearance, but all it really does is
> create a pseudo color stop with a value that is linearly 50% between two
> real stops in the color space. It then lets you move this point back and
> forth between the end points. The result is that each half of the transition
> takes up more or less room when the gradient is rasterised into an image.
> It's difficult to describe this via prose. If you have access to a copy of
> Photoshop, I suggest playing around with the gradient editor, or there are
> tutorial videos online that demonstrate midpoint adjustment.[1]
>
> While moving the mid-point does mean that the interpolation between the two
> stops is not strictly linear, the spec says that the between the colors of
> the stops and the midpoint is still linear. Therefore, the path taken
> through the color space will still be linear, with the associated problems I
> described.

Nope.  Seriously, read the algorithm.  It's not linear.  It's not
piecewise linear.  It's an exponential interpolation.  The spec
doesn't say anything about it being linear from the stop to the hint
either.

~TJ

Received on Wednesday, 21 January 2015 18:23:11 UTC