The input type of color allows a colour picker to be shown without using any external libraries.
When the input dialog is clicked it will open the system's native colour picker dialog. Set the colour of the selection using the value attribute, with the colour being a hex value.
Once selected the colour value is set, and can be used in JavaScript easily. The input element can also be styled to increase the size of the clickable area.
Add new comment