I want a simple colour picker in my app. So I thought I’d use the image and it’s map from:
https://www.w3schools.com/colors/colors_picker.asp
I copied the HTML code and I pasted it in i a HTML element, but can seem to get the map to work. Is it even possible to do like this?
Is it possible? Probably. Is it easy? No.
I’m not sure how you got the HTML, but there is a fair bit of javascript involved too. I don’t think a Bubble HTML element can capture an “onclick” type call (though I may be wrong).
Personally I think I would code a table and use a click on a cells colored block to set the color in the Bubble database. It would be tedious, but probably the most straightforward.
The HMTL was on the web page with the colour picker. And, that was my next concern - how to get the data from the click. Maybe as you say - to complicated, if even possible.
I found another smart solution:
https://www.cssscript.com/demo/pick-a-color-from-an-image-using-canvas-and-javascript/
I put this in a HTML element. Works fine. I then use the Toolbox plugin to send the colour the user clicks on back to Bubble with:
bubble_fn_1(rgbToHex(p[0],p[1],p[2]));