Happy Christmas Eve ! Coding away on Christmas Eve, sad eh? But it’s actually a great time to make some progress on hobbies. Got the day off, everything is ready for Christmas.
Anyone know a Color Chooser in JavaScript for p5.js ? Happy to hack some code that’s not quite ready, or convert something from Java, maybe the JColorChooser widget. think my preference would be something like the Mac color chooser from TextEdit, the “Spectrum” option, with colors laid out so you can choose H,S,B all off the same palette. Image below …
Tanvi Kumar has added it the p5 library. I couldn’t find it in the documentation but just use createColorPicker() and you should get a button. I copy and pasted the example from the source code into a sketch. I’ll look into why it’s not in the documentation.
I’m not sure why it’s not showing up. It’s part of the p5.dom but the screenshot I saw shows the link as being somewhere else in the reference. https://cdn-images-1.medium.com/max/1200/0*5AoWN3onIwiOCie4. I went there and got nothing so I searched the site for it and only one sketch from the web editor came up. I’m working on an issue for it unless someone can find it.
Thanks everyone. Great to see it’s already in there. I have it working in my code. I’m on Mac obviously. Looks like it invokes a native Mac color chooser, in fact the one I asked for. I tried it on Windows 7 and it invoked a similar native Windows color chooser. As several have mentioned, strange it’s not documented, for such a useful widget. Ciao e Buon Natale.