8000 Different interpolation rate per channel · Issue #637 · color-js/color.js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Different interpolation rate per channel #637
@LeaVerou

Description

@LeaVerou

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0