PitPik / colorPicker

Advanced javaScript color picker and color conversion / calculation (rgb, hsv, hsl, hex, cmyk, cmy, XYZ, Lab, alpha, WCAG 2.0, ...)
http://www.dematte.at/colorPicker/
MIT License
570 stars 136 forks source link

Add touch events + corrections (IE8-...) + class prefix isolation + improvements #47

Open aruben-c opened 8 years ago

aruben-c commented 8 years ago

Hi, I made some corrections and improvements to your ColorPicker. You can see all of them in my GitHub repository.

Corrections:

Improvements:

Tests: Touch events successfully tested on a smartphone with Android 4.4.2 / Chrome 51. IE8- tests OK All others tested in IE8/11/Edge, Chrome, Firefox, Opera.

3 files are changed:

I also impacted into:

but, it's need to also change:

For touch events, the files "javascript_implementation/jsColor.js" and "jQuery_implementation/jqColor.js" don't need to be changed (despite they call the event "mousedown"). But I changed them for the namespace.

The namespace add a constraint: the variable "var CPNamespace = window;" (or "var CPNamespace;") needs to be defined before loading the files. (nb: the first parameter "window" of the functions can't be the namespace due to the use of "window.Math").

Thanks for this nice color picking widget. ARuben