-
-
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
Add list support for lerpColor
like other color functions
#6954
Add list support for lerpColor
like other color functions
#6954
Conversation
Thanks, looks good!
Do you mean this as in, we don't want to support this, or the |
I mean this as in I understand why you wouldn't support it, but I personally would prefer if it were supported. I'd be fine with adding the |
although I can see that heavy lifting is being done by the Color constructor underneath, will it still be valuable to add examples and unit tests for this update in behavior? |
Probably not. It's pretty expected behavior. |
Agreed that it's probably OK to leave it as is. Maybe we can just add |
Should we add lists as well and all other types that can be converted into p5.Color? Because for |
I've added that instead for now to correspond better to the rest of p5.js's documentation instead of include all types (that would create inconsistencies although it could be nicer for some stuff). |
That works, thanks! |
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.
thanks!
Resolves #6953
Changes:
Adds list support to the
lerpColor
like other color functions.(I understand why this function doesn't support string based colors since you should know the actual value of the color when lerping between them, but adding list support is still definitely something that would be useful as seen in the referenced issue. However, if anyone thinks that adding string based color support to
lerpColor
as well would be preferred I'll add that to the PR.)Screenshots of the change:
PR Checklist
npm run lint
passes