colorPicker icon indicating copy to clipboard operation
colorPicker copied to clipboard

How to access colorPicker object?

Open johnmastri opened this issue 7 years ago • 1 comments

From your jQuery example:

$myColorPicker = $('input.color').colorPicker({
		customBG: '#222',
		readOnly: true,
		init: function(elm, colors) { // colors is a different instance (not connected to colorPicker)
			elm.style.backgroundColor = elm.value;
			elm.style.color = colors.rgbaMixCustom.luminance > 0.22 ? '#222' : '#ddd';
		},
		// appendTo: document.querySelector('.the-paragraph')
		// renderCallback: function(colors, mode) {
		// 	console.log(mode);
		// }
		// memoryColors: memoryColors,
		// actionCallback: function(event, type) {
		// 	if (type === 'toMemory') {
		// 		// $myColorPicker.renderMemory(memoryColors);
		// 	}
		// }
	}).each(function(idx, elm) {
		// $(elm).css({'background-color': this.value})
	});

I would think doing console.log($myColorPicker) would return the instance of the colorPicker - but it is returning an array. How do I access the colorPicker object (so I can access it's methods, setColor, etc..)?

Thanks!

johnmastri avatar Feb 07 '17 18:02 johnmastri