GcColor version 1.0.3 (updated on: 2009-03-05)
About
GcColor is a remake of Stefan Petre's jQuery colorpicker plug-in. Main purpose of rewriting this plug-in was a diferent ideology of plug-in's architecture.
- Stefan's plug-in created multiple DOM instances of colorpicker dialog in page (one dialog per input element).
- I could not get direct link back to callee element without knowing it's ID.
- The HSB to RGB calculation's had some bug where calculation from HEX color value to RGB, then to HSB, then back to RGB and then back to HEX gave diferent value from initial HEX value (for example #431313 showed up as #421212). This one was mostly fault of JavaScript floating point calculations, so i tried some other algorythms here and wrote it down from this one.
For now the plugin only support slide-down interface, but in the future I hope to make flat mode
Download
- Downdload (ZIP, 77.5Kb)
- Downdload Minified (coming soon)
- Downdload Packed (coming soon)
Older releases
Demo
Requirements
Options explained
- onOpen - callback function, parameters:
- target - target input field
- onClose - callback function, parameters:
- target - object, target input field
- color - string, new color
- cancel - boolean, is this a cancel operation
- onChange - callback function, parameters:
- target - object, target input field
- color - string, new color
- useButton - boolean, weather or not to add a button after input field. If false, click will be activated on the input field.
Usage
$('input.color').gccolor();
Change Log
- 2009-03-05 (v1.0.3)
- Fixed position bug of button - added wrapper element around input field.
- Fixed Hue slider bug - color selection goes acording to GUI.
- No-button mode on initialization would return target element NOT wrapped in jQuery object.
- Removed sliding/value change animations so that IE would not lag so mutch (update on IE is performed after endDrag event).
- 2009-02-25 (v1.0beta) - Initial public release.
ToDo
- Add flat mode
- Add option for other elements, for example if gccolor is applied on other element than input, it will change background-color, or inner text