Open
Description
We support a progression
parameter for non-linear interpolation.
While potentially niche, I've ran across cases where one needs to have a different progression
per component, and it's nontrivial to do with the current API. My specific use case was around generating color palettes: you may want to interpolate the hue linearly, but the chroma is typically a power curve.
In terms of API, I'm thinking the same progression
parameter could take an object, e.g.
let r = new Color("lch(50 50 0)").range("lch(90 50 20)");
Color.range(r, {progression: {c: p => p ** 3});
Any coordinate not specified interpolates linearly.
Metadata
Metadata
Assignees
Labels
No labels