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

Curves(r,g,b) function does wrong interpolation #42

Open
pastissolo opened this issue Nov 22, 2017 · 0 comments
Open

Curves(r,g,b) function does wrong interpolation #42

pastissolo opened this issue Nov 22, 2017 · 0 comments

Comments

@pastissolo
Copy link

Hello,
the interpolation function to generate the 255 points of the rgb channels is wrong:
glfx.js line 806 is
function splineInterpolate(points) { var interpolator = new SplineInterpolator(points); var array = []; for (var i = 0; i < 256; i++) { array.push(clamp(0, Math.floor(interpolator.interpolate(i / 255) * 256), 255)); } return array; }
the line
array.push(clamp(0, Math.floor(interpolator.interpolate(i / 255) * 256), 255));
make no sense, probably it should be:
array.push(clamp(0, Math.floor((interpolator.interpolate(i) / 255) * 256), 255));

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