Looking for a p5.js Color Chooser widget


#1

Hi all,

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 …

Thanks ! Have a great Christmas.


#2

#3

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.


#4

Nice, I didn’t know about that 1! However as you have stated, it’s not in the reference yet! :flushed:


#5

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.


#6

I created an issue about this on the p5 repo. https://github.com/processing/p5.js/issues/3422


#7

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.