Creating colorpicker on HTML5 canvas

后端 未结 3 1707
北恋
北恋 2021-01-07 14:36

How to draw a colorpicker on HTML5 canvas?

3条回答
  •  天命终不由人
    2021-01-07 15:21

    I created a solution for you on HCT. You can see it here:

    http://www.html5canvastutorials.com/labs/html5-canvas-color-picker/

    The idea is to find a color picker image that you like and then draw it on the canvas. On the mousedown event, we can get the mouse coordinates and then use the image data of the color picker image to pick out the color.

    Hope this helps!

提交回复
热议问题