You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Better color lerping is the kind of thing I'd reach for a perceptual colorspace for, so I'm a little surprised to see that there doesn't seem to be a lerp function here.
Though I'm not sure how that would be implemented.
Right now, I'm using this:
doublesign(double v) => v >0?1:-1;
HSLuvColorlerpHsluv(HSLuvColor a, HSLuvColor b, double p) {
// find the shortest route through the hue circlevar forwards = (b.hue - a.hue);
var backwards =-(360- forwards.abs()) *sign(forwards);
var huePath = forwards.abs() < backwards.abs() ? forwards : backwards;
returnHSLuvColor.fromHSL(
(a.hue p * huePath) %360,
lerpDouble(a.saturation, b.saturation, p)!,
lerpDouble(a.lightness, b.lightness, p)!);
}
but of course, it does a kind of rainbow effect when the hues are far apart, which is not always going to be what people want.
The text was updated successfully, but these errors were encountered:
Better color lerping is the kind of thing I'd reach for a perceptual colorspace for, so I'm a little surprised to see that there doesn't seem to be a lerp function here.
Though I'm not sure how that would be implemented.
Right now, I'm using this:
but of course, it does a kind of rainbow effect when the hues are far apart, which is not always going to be what people want.
The text was updated successfully, but these errors were encountered: