1

在我的程序上: http ://www.taffatech.com/Paint.html

我想添加一个吸管工具。现在,我觉得我可以通过单击滴管图标然后单击画布上的某个位置,然后将十六进制值保存到变量来实现。我需要帮助的是如何更改我使用此变量的颜色选择器值?这是颜色选择器的代码,您可以在提供的链接上看到它。

$('#colorpickerHolder').ColorPicker({
  flat:     true,
  onChange: function (hsb, hex, rgb) { brushColour = "#" + hex; },
});

我打算使用这个吸管: http: //palebluepixel.org/2011/11/16/html5-canvas-eyedropper/

4

1 回答 1

1

大概这是http://www.eyecon.ro/colorpicker/

看起来你可以这样做:

$('#colorpickerHolder').ColorPickerSetColor('#0000ff');
于 2013-06-20T17:17:52.213 回答