EastDesire/jscolor
JavaScript color picker with opacity (alpha channel) and customizable palette. Single file of plain JS with no dependencies.
30 Releases
Latest: 2y ago
jscolor-2.5.22.5.2Latest
📋 Changes
- Added support for initing jscolor after DOMContentLoaded has fired. Thanks to @andrewcartwright1
jscolor-2.5.12.5.1
📋 Changes
- Added fix to avoid unnecessary repositioning during scroll
jscolor-2.5.02.5.0
📋 Changes
- Some elements are now styled using document-wide CSS dynamically appended to document's HEAD
- Added CSS that resets some important CSS properties of picker's elements to their initial values
- Added support for #RRGGBBAA format in palettes specified as string
- Slightly increased font size for button(s)
- Changed class names of some elements
jscolor-2.4.92.4.9
📋 Changes
- Updated redrawPosition() method to fix incorrect dialog positioning when using custom 'container'. Thanks to @Kirsdarkenvaar.
jscolor-2.4.82.4.8
📋 Changes
- Replaced deprecated 'substr' method with 'slice'. Thanks to contributor @CommanderRoot
jscolor-2.4.72.4.7
📋 Changes
- Removed captureTarget/releaseTarget (no longer needed)
jscolor-2.4.62.4.6
📋 Changes
- Added property 'random' and method randomize()
jscolor-2.4.52.4.5
📋 Changes
- Added support for #rrggbbaa notation (implemented as 'hexa' format)
jscolor-2.4.42.4.4
📋 Changes
- Picker's position is updated when scrolling the window
jscolor-2.4.32.4.3
📋 Changes
- Added option paletteSetsAlpha
- By default, palette colors that don't specify alpha will set alpha to 1.0, but only if the palette contains at least one color with transparency (alpha < 1.0)
jscolor-2.4.22.4.2
📋 Changes
- Fixed infinite loop bug that occurs when sliderSize or paletteCols is set to 0
- Added static method jscolor.ready() that calls given function as soon as jscolor is initialized
- Current color is now also reflected in 'data-current-color' attribute of the target element
- Public method getCurrentFormat() renamed back to getFormat()
jscolor-2.4.12.4.1
📋 Changes
- Added support for custom palette (swatch)
- Added options: palette, paletteCols, paletteHeight, paletteSpacing, hideOnPaletteClick
- Added value for option paletteCols into presets 'small', 'medium', and 'large'
jscolor-2.4.02.4.0
📋 Changes
- Added module wrapper to allow using jscolor as a module
- jscolor.init() method made public
jscolor-2.3.32.3.3
📋 Changes
- added option hideOnLeave
jscolor-2.3.22.3.2
📋 Changes
- limiting Close button's maximum width to prevent overflow
jscolor-2.3.12.3.1
📋 Changes
- the 'refine' option was removed
- added sliderSize values into presets 'small', 'medium', 'large'
- added buttonColor values into presets 'light' and 'dark'
- presets specify colors in rgba format
- linked elements now have their jscolor-related data stored in a single property '_data_jscolor'
jscolor-2.3.02.3.0
📋 Changes
- the 'hash' option is enabled by default
- fixed bug that the 'change' event wasn't re-triggered upon leaving the input field when its value was programmatically refined
- if dragging the alpha slider while format is 'any', the 'rgba' format will be forced
- the install() method now accepts an optional argument rootNode
- added method getFormat() that returns the color format currently in effect
- added possibility to specify the 'default' preset in the 'preset' option (useful for raising its priority over other presets)
- color-related options now have their default values in rgba format
jscolor-2.2.42.2.4
📋 Changes
- alpha slider will be automatically enabled if initial 'alpha' option is set
- disabled autocorrect and autocapitalize on valueElement and alphaElement
jscolor-2.2.32.2.3
📋 Changes
- fixed warning message for unparseable data-jscolor configuration
- specifying passive flag (false) when registering touch event listener to prevent console warning
- removed outdated polyfills for event listeners
jscolor-2.2.22.2.2
📋 Changes
- attaching ontouchstart listener only to picker box - this fixes usability issues on touch devices. (Thanks to Brendon M.)
- added static method jscolor.hide() that hides the color picker box (in addition to existing pickerInstance.hide() method)
jscolor-2.2.12.2.1
📋 Changes
- color picker won't show on disabled target elements
- increased default z-index to 5000
jscolor-2.2.02.2.0
📋 Changes
- added support for alpha channel (opacity) and RGBA output format
- added support for query selectors - elements can now be specified using CSS query selectors
- element IDs in all element-related options now must be prefixed with '#' character in order to be valid CSS selectors
- toString() method now returns a color code in current format (and includes leading '#' in case of HEX format)
- property styleElement renamed to previewElement
- property onFineChange renamed to onInput
- property overwriteImportant renamed to forceStyle
- property closable renamed to closeButton
- + 15 more
jscolor-2.1.12.1.1
📋 Changes
- added jscolor.presets property
- added <picker>.toGrayscale() method
- color picker box now hides when Enter or Escape key is pressed
- jscolor.options is now deprecated
jscolor-2.1.02.1.0
📋 Changes
- jscolor now installs on elements having 'data-jscolor' attribute
- class="jscolor" is no longer needed, but still supported for backward compatibility
- the 'jscolor' variable is now accessible via alias 'JSColor'
- added classes to color picker elements: 'jscolor-picker', 'jscolor-picker-wrap', 'jscolor-picker-shadow', 'jscolor-picker-border', 'jscolor-btn-close'
- prints console warning when trying to set an unrecognized configuration option
- valueElement's value is now being set only if it differs from the new value
jscolor-2.0.42.0.4
📋 Changes
- Added a minified version (generated using UglifyJS)
jscolor-2.0.32.0.3
📋 Changes
- Fixed bug which prevented closing the picker during tap event on touch devices
- jscolor instance now gets registered only once, even if the <script> is included multiple times
jscolor-2.0.22.0.2
📋 Changes
- Improved color picker positioning
- When resizing browser window, color picker position is continuously updated
- When scrolling one of the offsetParents, color picker is hidden
- Fixed positioning is now autodetected, no need to set the parameter 'fixed'
- Added support for rgb color notation, e.g. rgb(160, 0, 255)
- Added toHEXString() and toRGBString() methods
jscolor-2.0.02.0.0
jscolor-1.4.5v1.4.5
jscolor-1.4.2v1.4.2
