Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle piecewise interpolation using easing functions t_in => t_out with t_out outside [0, 1] range #140

Closed
danburzo opened this issue Aug 8, 2021 · 1 comment

Comments

@danburzo
Copy link
Collaborator

danburzo commented Aug 8, 2021

For example,

let culori = require("culori");
let BezierEasing = require('bezier-easing');

const easing = BezierEasing(0.425, -0.165, 0.350, 1.465);
const colors = culori.samples(20).map(
  culori.interpolate([easing, '#ff0000', '#cc8833', '#3344cc'])
).map(culori.formatRgb);

console.log(colors);

colors contains NaNs because the Bézier easing produces values outside the expected range.

@danburzo
Copy link
Collaborator Author

danburzo commented Aug 8, 2021

Fixed in d75f9bf

@danburzo danburzo closed this as completed Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant