jQuery.fn.glowColorSelector
This plugin decorates a text input with a popup color selection tool.
Usage
Initiate a selection of text inputs to display a color selection tool when focused.
$('selector').glowColorSelector(options)
where selector contains <input type="text" />
element(s) and options
is an optional object argument
Options
blendImageUrl
: image used as the background for color blending. Evolution pre-sets intelligent defaultshueBlendImageUrl
: image used as the background for hue blending. Evolution pre-sets intelligent defaultsalphaBlendImageUrl
: image used as the background for alpha blending. Evolution pre-sets intelligent defaultstransparentImageUrl
: image used as a background to show transparency. Evolution pre-sets intelligent defaultszIndex
: the z-index of the color selection popup. Defaults to 1000.
Events
change
: triggered on color selection
Methods
val
Retrieves and/or sets the current value of the color selector. The value of the selected text input is also updated by the color selector.
// get the current color
var value = $('selector').glowColorSelector('val');
// set the current color to red
$('selector').glowColorSelector('val', '#FF0000')
disabled
Retrieves and/or sets whether the color selection popup is disabled. When enabled, focusing on the input will pop open the color selector. When disabled, it will not.
// get the current disabled state
var isDisabled = $('selector').glowColorSelector('disabled');
// set the disabled state
$('selector').glowColorSelector('disabled', false);