-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
added paletteLerp #6960
added paletteLerp #6960
Conversation
Here's what the new version requested using color stops uses: function setup() {
createCanvas(400, 400);
}
function draw() {
background(lerpPalette([
["white", 0],
["red", 0.05],
["green", 0.25],
["blue", 1]
], millis() / 10000 % 1));
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! You mentioned on Discord potentially having a version that supports just an array of numbers for evenly-spaced stops, do you want me to wait before merging for that or do you want that to be a follow-up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked on Discord and probably will end up doing another PR if we want to add a version with no stops, so I'll merge this now!
Resolves #6959
Changes:
Add a function called
paletteLerp()
for lerping/interpolating between a list/palette of colors.Screenshots of the change:
PR Checklist
npm run lint
passes