-
-
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
Color picker <input> for DOM library #2504
Comments
As you mentioned As for returning a Perhaps you have some use cases where |
I'm surprised you think its unnecessary having an easy way to input a color in a graphics library. If It's not that the current method isn't viable to use, it's just inconsistent with the rest of the dom library. Currently, if you want to create a color input and choose the color it starts with, you have to convert it to a hex color code manually, and you can't create one without choosing a default color. Using Having the ability to parse p5.Color objects to hex strings would still be useful even if createColor() doesn't get used. To show what I mean, I've rewritten With that change, at least you could create a new color input with |
All other issues aside, I think 'createColorPicker' would be a better name. |
@amoetodi As @Spongman mentioned, To have p5.Color being able to return different kind of color strings is great and I don't object to that at all. I would suggest filing a PR for that. |
You're right, those are better ideas. I'll finish my changes to |
I'd like to work on this new method. I'm hoping to discuss the possible parameters for this method. |
fixed with #3089 |
Nature of issue?
Most appropriate sub-area of p5.js?
New feature details:
I was thinking it'd be useful if there was a quick and easy way to add the color picker DOM element with p5.js by doing something like
createColor()
. It's possible tocreateInput('#ffffff', 'color')
but callingvalue()
on this input returns a hex color string, it'd be nice to be able to read and write the value as ap5.Color
. For this I was thinking it'd be useful to parameterize theColor.toString()
function so it could format the string in different ways, in this case as a 6 digit hex color code.I'm going to attempt to implement this.
The text was updated successfully, but these errors were encountered: