Simple circular color picker in JavaScript with scroll and touchscreen support.
type="simple" |
type="complex" |
---|---|
- None
- simply add
<div class="colorpicker" type="simple"></div>
or
<div class="colorpicker" type="complex"></div>
to your HTML code
-
Set the size with a bit of CSS
-
Put all resources into the resources folder
-
Add
<script src="./resources/colorpicker.js"></script>
to the bottom of the page -
Add an EventListener to the colorpicker element and listen for the 'colorchange' event. The color values are stored in
event.detail.color
-
You're done!
Sebastian Faul - [email protected]