Skip to content
Newer
Older
100644 501 lines (391 sloc) 16.7 KB
495f2de Allow click on altField to show colorpicker
Martijn authored
1 jQuery.colorpicker
2 ==================
6246708 @vanderlee Fix #115; changed "changed" behaviour for cancel/ok buttons.
authored
3 Version 1.1.8
9973bf8 @vanderlee Copyright
authored
4
6246708 @vanderlee Fix #115; changed "changed" behaviour for cancel/ok buttons.
authored
5 Copyright © 2011-2016 Martijn W. van der Lee.
9973bf8 @vanderlee Copyright
authored
6 Licensed under the MIT.
7
8 Full-featured colorpicker for jQueryUI with full theming support.
9 Most images from jPicker by Christopher T. Tillman.
bfe22ff @vanderlee Minor features and start of documentation in README
authored
10 Sourcecode created from scratch by Martijn W. van der Lee.
11
7acbc4e @vanderlee Improved documentation
authored
12 IE support; make sure you have a doctype defined, or the colorpicker will not
13 display correctly.
bfe22ff @vanderlee Minor features and start of documentation in README
authored
14
33e6e7b Improvements
Martijn van der Lee authored
15 Features
16 --------
17 - jQueryUI (themeroller-based) look & feel
18 - Familiar interface layout
19 - Highly configurable
20 - Control parts
21 - Layout
22 - Input/output formats
23 - Swatches
24 - Many more
25 - Accurate color model
26 - Supports localization
27 - English, Dutch, French, etc.
091f57f @vanderlee Added `stop` event.
authored
28 - Easily translatable (https://www.transifex.com/projects/p/jquery-colorpicker/)
33e6e7b Improvements
Martijn van der Lee authored
29 - Smart window alignment
30 - Complete API with events and methods
31 - Easily extendable with plugins
7acbc4e @vanderlee Improved documentation
authored
32 - Many examples included: RGB-Sliders with CSS gradients, Per-user cookie
33 memory for colors.
33e6e7b Improvements
Martijn van der Lee authored
34 - Documented
35 - Limited Unit tests (QUnit-based)
36
37 Download
38 --------
c9bc0ce Bower added
Martijn authored
39 Install with bower using `bower install colorpicker`.
40
33e6e7b Improvements
Martijn van der Lee authored
41 jQuery v1.7.1 or higher required. (Will not work with v1.6 or before).
42
43 jQueryUI v1.8.0 or higher required.
44
ee3f0e3 Changed tristate to colorpicker
Martijn van der Lee authored
45 Current version: https://github.com/vanderlee/colorpicker/archive/master.zip
33e6e7b Improvements
Martijn van der Lee authored
46
091f57f @vanderlee Added `stop` event.
authored
47 Source code on Github: https://github.com/vanderlee/colorpicker
33e6e7b Improvements
Martijn van der Lee authored
48
d7263f7 @vanderlee Added jQueryUI custom build components
authored
49 jQueryUI custom build
50 ---------------------
51 If you download a custom build of jQueryUI, you need these components:
52
53 * Dialog (includes Core, Widget, Mouse, Position, Draggable and Resizable)
54 * Fade Effect (only if you use the `showAnim` option, includes Effects Core)
55
56 To use the `parts/jquery.ui.colorpicker-rgbslider.js` plugin, you must add:
57
58 * Slider (includes Core, Widget and Mouse)
59
60 To use the demo page included in the documentation, you must add:
61
62 * Tabs (includes Core and Widget)
63
33e6e7b Improvements
Martijn van der Lee authored
64 Browser support
65 ---------------
6246708 @vanderlee Fix #115; changed "changed" behaviour for cancel/ok buttons.
authored
66 Tested various versions of this plugin with the following browsers:
33e6e7b Improvements
Martijn van der Lee authored
67
6246708 @vanderlee Fix #115; changed "changed" behaviour for cancel/ok buttons.
authored
68 - Chrome 31-47
69 - FireFox 25-43
70 - Opera 17-34
71 - Internet Explorer 10-11
72 - Edge 20
33e6e7b Improvements
Martijn van der Lee authored
73
74 Documentation
75 =============
76 `.colorpicker(options)`
77 --------------------
78 Turns an element into a colorpicker.
79
495f2de Allow click on altField to show colorpicker
Martijn authored
80 Options
81 -------
6a3c751 Added parser and writer plugins
Martijn authored
82 ### alpha (false)
642ef4c Added parser and writer plugins
Martijn authored
83 Whether or not to show the inputs for alpha.
84
6a3c751 Added parser and writer plugins
Martijn authored
85 ### altAlpha (true)
642ef4c Added parser and writer plugins
Martijn authored
86 Change the opacity of the altField element(s) according to the alpha setting.
87
6a3c751 Added parser and writer plugins
Martijn authored
88 ### altField ('')
642ef4c Added parser and writer plugins
Martijn authored
89 Change the background color of the elements specified in this element.
90
6a3c751 Added parser and writer plugins
Martijn authored
91 ### altOnChange (true)
642ef4c Added parser and writer plugins
Martijn authored
92 If true, the altField element(s) are updated on every change, otherwise
93 only upon closing.
94
6a3c751 Added parser and writer plugins
Martijn authored
95 ### altProperties (background-color)
642ef4c Added parser and writer plugins
Martijn authored
96 Comma-separated list of CSS properties to set color of in the altField.
97 The following properties are allowed, all others are ignored.
33e6e7b Improvements
Martijn van der Lee authored
98
c74cbb8 Added parser and writer plugins
Martijn authored
99 * ``background-color``
100 * ``border-color``
cd4dae1 Documented new altProperties
Martijn van der Lee authored
101 * ``color``
102 * ``fill``
c74cbb8 Added parser and writer plugins
Martijn authored
103 * ``outline-color``
cd4dae1 Documented new altProperties
Martijn van der Lee authored
104 * ``stroke``
640270d @vanderlee Implemented altProperties, based on work by mweimerskirch
authored
105
3831eab Added parser and writer plugins
Martijn authored
106 ### autoOpen (false)
107 If true, the dialog opens automatically upon page load.
108
109 ### buttonClass (null)
110 If this option is set to a string, the button will be assigned the
111 class specified.
112
113 ### buttonColorize (false)
091f57f @vanderlee Added `stop` event.
authored
114 If a `buttonImage` is specified, change the background color of the
3831eab Added parser and writer plugins
Martijn authored
115 image when the color is changed.
116
117 ### buttonImage ('images/ui-colorpicker.png')
118 Same as jQueryUI DatePicker.
119
120 ### buttonImageOnly (false)
121 Same as jQueryUI DatePicker.
122
123 ### buttonText (null)
124 Same as jQueryUI DatePicker. If null, use language default.
125
126 ### closeOnEscape (true)
127 Close the window when pressing the Escape key on the keyboard.
128
129 ### closeOnOutside (true)
130 Close the window when clicking outside the colorpicker display.
131
132 ### color ('#00FF00')
133 Initial color. Formats recognized are:
33e6e7b Improvements
Martijn van der Lee authored
134
3831eab Added parser and writer plugins
Martijn authored
135 * #rrggbb
136 * rrggbb (same as previous, but without the #)
137 * rgb(rrr,ggg,bbb)
138 * rgba(rrr,ggg,bbb,a.a)
139 * rgb(rrr%,ggg%,bbb%)
140 * rgba(rrr%,ggg%,bbb%,aaa%)
141 * w3c-defined color name
142
143 ### colorFormat ('HEX')
144 Specifies the format of the color string returned in callbacks.
145 You can either specify one of the predefined formats:
33e6e7b Improvements
Martijn van der Lee authored
146
e9618b1 Added feature request #66; CSS4 hex-with-alpha color formats (HEXA, H…
Martijn authored
147 * ``#HEX`` #112233 (#RRGGBB)
148 * ``#HEX3`` #123 (#RGB) if possible, otherwise false.
149 * ``HEX`` 112233 (RRGGBB)
150 * ``HEX3`` 123 (RGB) if possible, otherwise false.
151 * ``#HEXA`` #11223344 (#RRGGBBAA)
b2351ae Added feature request #66; CSS4 hex-with-alpha color formats (HEXA, H…
Martijn authored
152 * ``#HEXA4`` #1234 (#RGBA) if possible, otherwise false.
e9618b1 Added feature request #66; CSS4 hex-with-alpha color formats (HEXA, H…
Martijn authored
153 * ``HEXA`` 11223344 (RRGGBBAA)
b2351ae Added feature request #66; CSS4 hex-with-alpha color formats (HEXA, H…
Martijn authored
154 * ``HEXA4 `` 1234 (RGBA) if possible, otherwise false.
c74cbb8 Added parser and writer plugins
Martijn authored
155 * ``RGB`` rgb(123,45,67) if opaque, otherwise false.
156 * ``RGBA`` rgba(123,45,67,0.123%)
157 * ``RGB%`` rgb(12%,34%,56%) if opaque, otherwise false.
158 * ``RGBA%`` rgba(12%,34%,56%,0.123%)
159 * ``HSL`` hsl(123,45,67) if opaque, otherwise false.
160 * ``HSLA`` hsla(123,45,67,0.123%)
161 * ``HSL%`` hsl(12%,34%,56%) if opaque, otherwise false.
162 * ``HSLA%`` hsla(12%,34%,56%,0.123%)
163 * ``NAME`` Closest color name
164 * ``EXACT`` Exact name if possible, otherwise false.
33e6e7b Improvements
Martijn van der Lee authored
165
3831eab Added parser and writer plugins
Martijn authored
166 or specify your own format...
167 Each color channel is specified as a pair of two characters.
168 The first character determines the color channel:
33e6e7b Improvements
Martijn van der Lee authored
169
c74cbb8 Added parser and writer plugins
Martijn authored
170 * ``a`` Alpha
171 * ``r, g, b`` RGB color space; red, green and blue
172 * ``h, s, v`` HSV color space; hue, saturation and value
173 * ``c, m, y, k`` CMYK color space; cyan, magenta, yellow and black
174 * ``L, A, B`` LAB color space; Luminosity, *A and *B.
33e6e7b Improvements
Martijn van der Lee authored
175
3831eab Added parser and writer plugins
Martijn authored
176 The second character specifies the data type:
33e6e7b Improvements
Martijn van der Lee authored
177
c74cbb8 Added parser and writer plugins
Martijn authored
178 * ``x`` Two-digit hexadecimal notation.
179 * ``d`` Decimal (0-255) notation.
180 * ``f`` Floating point (0-1) notation, not rounded.
181 * ``p`` Percentage (0-100) notation, not rounded.
33e6e7b Improvements
Martijn van der Lee authored
182
3831eab Added parser and writer plugins
Martijn authored
183 If you prefix a valid pair with a backslash, it won't be replaced.
184 All patterns are case sensitive.
185 For example, to create the common hex color format, use "#rxgxbx".
186 For an rgba() format, use "rgba(rd,gd,bd,af)"
187
188 You can also specify an array of formats where the first non-FALSE one
189 is returned. Note that the only formats able to return FALSE are the
190 predefined formats HEX3 and EXACT. For example, this array will output
191 HEX3 format if possible or HEX format otherwise:
33e6e7b Improvements
Martijn van der Lee authored
192
c74cbb8 Added parser and writer plugins
Martijn authored
193 * ``['HEX3', 'HEX']``
3831eab Added parser and writer plugins
Martijn authored
194
a7c32fb Fix for #80: New option 'containment'.
Pablo Gra\~na authored
195 ### draggable (true)
3831eab Added parser and writer plugins
Martijn authored
196 Make the dialog draggable if the header is visible and the dialog is
197 not inline.
198
a7c32fb Fix for #80: New option 'containment'.
Pablo Gra\~na authored
199 ### containment (null)
200 If the dialog is draggable, constrains dragging to within the bounds of the
201 specified element or region. Same as jQueryUI Draggable.
202
3831eab Added parser and writer plugins
Martijn authored
203 ### duration ('fast')
204 Same as jQueryUI DatePicker.
205
e37e997 @vanderlee hideOn option added
authored
206 ### hideOn ('button')
207 Specifies what user events will hide the colorpicker if not inline.
208 Specify multiple events by separating with space.
209
210 * ``focus`` When the element goes out of focus (either tab or click)
211 * ``click`` When the element is clicked (for non-inputs)
212 * ``alt`` When clicking on an element specified with as altField
213 * ``button`` When clicking on the button created if this event is specified.
214 * ``all`` selects all possible triggers
215 * ``both`` same as ``all`` (deprecated, kept backwards compatibility)
216
3831eab Added parser and writer plugins
Martijn authored
217 ### hsv (true)
218 Whether or not to show the inputs for HSV.
219
220 ### inline (true)
221 If set to false, attaching to a non-input will still make the dialog
222 a popup instead of inline. Make sure you handle events to catch the
223 color change, otherwise you can't use the color.
224
225 ### inlineFrame (true)
226 If enabled, shows a border and background when inline. Disabling may
227 allow closer integration.
228
229 ### layout ({ ... })
230 Set the position of elements in a table layout.
231 You could create any layout possible with HTML tables by specifying
232 cell position and size of each part.
091f57f @vanderlee Added `stop` event.
authored
233
234 The layout option takes a map (object) with each property name matching one of
235 the available parts (including any possible custom or plugin parts). The value
236 is a an array with four coordinates on order `[`left`, `top`, `width`,
237 `height`]`.
238
239 The coordinates correspond to cells in a table, so if you want to have a part
240 at top-left and spanning two rows and three columns, the value would be
241 `[0, 0, 3, 2]`.
242
243 Care should be taken to ensure no parts overlap (best to just draw out a grid
244 on paper first). Behavior is undefined if parts overlap. You need not cover
245 the entire rectangular area; any empty cells will be simply remain empty.
246
247 The default layout is as follows:
248
249 {
250 map: [0, 0, 1, 5],
251 bar: [1, 0, 1, 5],
252 preview: [2, 0, 1, 1],
253 hsv: [2, 1, 1, 1],
254 rgb: [2, 2, 1, 1],
255 alpha: [2, 3, 1, 1],
256 hex: [2, 4, 1, 1],
257 lab: [3, 1, 1, 1],
258 cmyk: [3, 2, 1, 2],
259 swatches: [4, 0, 1, 5]
260 }
3831eab Added parser and writer plugins
Martijn authored
261
262 ### limit ('')
263 Limit the selectable colors to any of the predefined limits:
33e6e7b Improvements
Martijn van der Lee authored
264
7acbc4e @vanderlee Improved documentation
authored
265 * ``''`` No limitations, allow 8bpp color for a palette of all 16 million
266 colors.
267 * ``websafe`` Set of 216 colors composed of 00, 33, 66, 99, cc and ff color
268 channel values in #rrggbb.
269 * ``nibble`` 4 bits per color, can be easily converted to #rgb format. The
270 palette is limited to 4096 colors.
271 * ``binary`` Allow only #00 or #ff as color channel values for primary colors
272 only; only 8 colors are available with this limit.
c74cbb8 Added parser and writer plugins
Martijn authored
273 * ``name`` Limit to closest color name.
3831eab Added parser and writer plugins
Martijn authored
274
275 ### modal (false)
276 Ensures no other controls on screen can be used while the dialog is
277 opened.
278 Also look at showCancelButton and closeOnEscape to use in combination
279 with the modal option. closeOnOutside is redundant when used with modal.
280
281 ### mode ('h')
282 Determines the functionality of the map and bar components. Allowed
283 values are; 'h', 's', 'l', 'r', 'g', 'b' or 'a', for hue, saturation,
284 luminosity, red, green, blue and alpha respectively.
285
e4d95cf Fix for #58; okOnEnter option
Martijn authored
286 ### okOnEnter (false)
7acbc4e @vanderlee Improved documentation
authored
287 Close the window when pressing the Enter key on the keyboard, keeping the
288 selected color.
e4d95cf Fix for #58; okOnEnter option
Martijn authored
289
33e6e7b Improvements
Martijn van der Lee authored
290 ### part
7acbc4e @vanderlee Improved documentation
authored
291 Use the part option to specify options specific to parts (including plugin
292 parts). By default, the following part options are available:
33e6e7b Improvements
Martijn van der Lee authored
293
3831eab Added parser and writer plugins
Martijn authored
294 ### parts ('')
295 Determine which parts to display.
a248387 Added revert.
Martijn authored
296 Use any of the preset names ('full', 'popup' or 'inline') or specify an array
297 of part names (i.e. ['header', 'map', 'bar', 'hex', 'hsv',
3831eab Added parser and writer plugins
Martijn authored
298 'rgb', 'alpha', 'lab', 'cmyk', 'preview', 'swatches', 'footer']).
299 If an empty string is given, the parts will be automatically chosen as
300 preset 'popup' or 'inline' depending on the context in which the
301 colorpicker is used.
302
83dcbea Added feature request #76 by adding standard jQueryUI `position` option.
Martijn authored
303 ### position (null)
304 Specify the position of the dialog as a jQueryUI position object.
305 See [jQueryUI .position() API documentation](http://api.jqueryui.com/position/)
306 for information on how to use.
307 ColorPicker adds an additional option to the `of` option; the value `'element'`
308 will refer to the element to which the ColorPicker is attached, including if it
309 is invisible).
310 By default, the dialog will attached to the bottom-left of the element, flipping
311 on collision.
312
a248387 Added revert.
Martijn authored
313 ### regional ('')
314 Sets the language to use. Note that you must load the appropriate language file
315 from the i18n directory. '' is included by default.
316
317 ### revert (false)
318 If enabled, closing the dialog through any means but the OK button will revert
319 the color back to the previous state, as if pressing the Cancel button.
091f57f @vanderlee Added `stop` event.
authored
320 The revert option changes the behavior of the [X] button in the header, the
a248387 Added revert.
Martijn authored
321 Escape keyboard button and clicking outside the dialog, when any of these
322 features are enabled.
323
3831eab Added parser and writer plugins
Martijn authored
324 ### rgb (true)
325 Whether or not to show the inputs for RGB.
326
327 ### showAnim ('fadeIn')
328 Same as jQueryUI DatePicker.
329
330 ### showCancelButton (true)
331 Show the Cancel button if buttonpane is visible.
332
333 ### showCloseButton (true)
334 Show the Close button if the header is visible.
335 If the dialog is inline, the close button is never shown.
336
337 ### showNoneButton (false)
338 Show the None/Revert button if buttonpane is visible.
339
340 ### showOn ('focus click alt')
e37e997 @vanderlee hideOn option added
authored
341 Specifies what user events will show the colorpicker if not inline.
342 Specify multiple events by separating with space.
33e6e7b Improvements
Martijn van der Lee authored
343
c74cbb8 Added parser and writer plugins
Martijn authored
344 * ``focus`` When the element comes into focus (either tab or click)
345 * ``click`` When the element is clicked (for non-inputs)
346 * ``alt`` When clicking on an element specified with as altField
347 * ``button`` When clicking on the button created if this event is specified.
e37e997 @vanderlee hideOn option added
authored
348 * ``all`` selects all possible triggers
349 * ``both`` same as ``all`` (deprecated, kept backwards compatibility)
3831eab Added parser and writer plugins
Martijn authored
350
351 ### showOptions ({})
c74cbb8 Added parser and writer plugins
Martijn authored
352 Same as jQueryUI DatePicker.
c1e562e @vanderlee Fixes to the layout system
authored
353
3831eab Added parser and writer plugins
Martijn authored
354 ### swatches (null)
c74cbb8 Added parser and writer plugins
Martijn authored
355 'null' to show swatches of HTML colors or provide your own object
356 with colornames and {r:1, g:1, b:1} array.
357 For example { 'red': {r:1, g:0, b:0}, 'blue': {r:0, g:0, b:1} }
358 Alternatively, load a predefined set of swatches and specify the name.
359 For example, for the pantone set, specify 'pantone'.
7244d4a Load and use custom (predefined sets of) swatches.
Martijn authored
360
3831eab Added parser and writer plugins
Martijn authored
361 ### swatchesWidth (84)
362 Width of the swatches display in pixels.
c1e562e @vanderlee Fixes to the layout system
authored
363
3831eab Added parser and writer plugins
Martijn authored
364 ### title (null)
365 Title to display in the header. If null, use language default.
6da4dbf @vanderlee Removed _getColorFromInputs from inputs, allowing it to be split in t…
authored
366
495f2de Allow click on altField to show colorpicker
Martijn authored
367 Events
368 ------
091f57f @vanderlee Added `stop` event.
authored
369 ### cancel (event, {formatted: ..., colorPicker: ...})
370 Triggered when the dialog is closed through the cancel button.
3831eab Added parser and writer plugins
Martijn authored
371
091f57f @vanderlee Added `stop` event.
authored
372 ### close (event, {formatted: ..., colorPicker: ...})
3831eab Added parser and writer plugins
Martijn authored
373 Triggered when the popup is closed.
091f57f @vanderlee Added `stop` event.
authored
374
375 Callbacks receive same data as select event and an additional number
3831eab Added parser and writer plugins
Martijn authored
376 of fields containing the current color in all supported color spaces.
091f57f @vanderlee Added `stop` event.
authored
377 These are `rgb{}`, `hsv{}`, `cmyk{}`, `lab{`, `hsl{}` and `a`.
3831eab Added parser and writer plugins
Martijn authored
378 Most values are floating point numbers in range [0,1] for accuracy.
379 The a and b values in the lab color space have range [-1,1].
380
091f57f @vanderlee Added `stop` event.
authored
381 ### init (event, {formatted: ..., colorPicker: ...})
382 Triggered on initially setting the color. Called only once.
383 Callbacks receive same data as select event.
384
385 ### ok (event, {formatted: ..., colorPicker: ...})
386 Triggered when the dialog is closed through the cancel button.
387
388 ### open (event, {formatted: ..., colorPicker: ...})
389 Triggered whenever the dialog is opened.
390
391 ### select (event, {formatted: ..., colorPicker: ...})
3831eab Added parser and writer plugins
Martijn authored
392 Triggered on each change, confirmation (click on OK button) and
393 cancellation (click on Cancel, outside window or window close button)
394 respectively.
395
091f57f @vanderlee Added `stop` event.
authored
396 The event receives a jQuery event object, a data object containing the elements
397 'formatted' (with the color formatted according to `formatColor`) and the
b0c66c2 Documented hmhofman's additions
Martijn van der Lee authored
398 Colorpicker element that triggered the event.
3831eab Added parser and writer plugins
Martijn authored
399
400 Note that select may be triggered in rapid succession when dragging
091f57f @vanderlee Added `stop` event.
authored
401 the mouse across the map or bar and may be triggered without a change
3831eab Added parser and writer plugins
Martijn authored
402 in color upon specific user interactions.
6da4dbf @vanderlee Removed _getColorFromInputs from inputs, allowing it to be split in t…
authored
403
091f57f @vanderlee Added `stop` event.
authored
404 ### stop(event, {formatted: ..., colorPicker: ...})
405 Triggered when the user stops changing a control. This only affects the map
406 and bar parts. Where the `select` event will trigger on each mouse move, the
407 `stop` event will only trigger when the mouse button is released. For other
408 controls, `stop` and `select` are both triggered.
409
410 The callback is otherwise identical to `select`. When both are triggered,
411 `select` is triggered before `stop`.
412
495f2de Allow click on altField to show colorpicker
Martijn authored
413 Methods
414 -------
3831eab Added parser and writer plugins
Martijn authored
415 ### open
416 Open the dialog
c1e562e @vanderlee Fixes to the layout system
authored
417
3831eab Added parser and writer plugins
Martijn authored
418 ### close
419 Close the dialog
c1e562e @vanderlee Fixes to the layout system
authored
420
3831eab Added parser and writer plugins
Martijn authored
421 ### destroy
422 Destroy the widget
9d760eb @vanderlee Lowercase color names
authored
423
3831eab Added parser and writer plugins
Martijn authored
424 ### setColor
425 Set the current color to the specified color. Accepts any CSS-confirming color
426 specification.
5a8cf29 parser plugins
Martijn authored
427
428 Plugins
429 -------
430 Colorpicker is extensible with several types of plugins. A number of plugins
431 is provided for use. The plugins are constructed such that you only need to
432 load the javascript file after the Colorpicker plugin itself is loaded.
433
dfc855f Extensible partslists and limits
Martijn authored
434 ### limits
435 Limits let you limit the possible colors, as used by the 'limit' option.
436
437 No plugins included.
438
920ca14 Added parser and writer plugins
Martijn authored
439 ### parsers
a248387 Added revert.
Martijn authored
440 Parser take a textual representation of a color and return a Color object.
441 If no match is found, nothing is returned and the next parser is tried.
442 Parsers are tried in order of appearance.
920ca14 Added parser and writer plugins
Martijn authored
443
444 Included plugins:
7acbc4e @vanderlee Improved documentation
authored
445 * ``cmyk-parser`` Parses a ``cmyk(c, y, m, k)`` format, similar
446 to rgba.
447 * ``cmyk-percentage-parser`` Parses a ``cmyk(c%, y%, m%, k%)`` format with
448 percentages.
5a8cf29 parser plugins
Martijn authored
449
c74cbb8 Added parser and writer plugins
Martijn authored
450 ### parts
451 You can add additional visual parts, usually controls, that interact
452 with the rest of Colorpicker framework.
5a8cf29 parser plugins
Martijn authored
453
920ca14 Added parser and writer plugins
Martijn authored
454 Included plugins:
7acbc4e @vanderlee Improved documentation
authored
455 * ``memory`` Cookie-based memory nodes.
456 * ``rgbsliders`` Set of three red/green/blue sliders with dynamically
457 adjusted gradients.
458 * ``swatchesswitcher`` Switch through all available sets of swatches.
920ca14 Added parser and writer plugins
Martijn authored
459
dfc855f Extensible partslists and limits
Martijn authored
460 ### partslists
7acbc4e @vanderlee Improved documentation
authored
461 Partslists are a convenient way to select multiple parts at once without having
462 to specify each one individually.
dfc855f Extensible partslists and limits
Martijn authored
463
464 No plugins included.
465
920ca14 Added parser and writer plugins
Martijn authored
466 ### regional
467 Regional (in the i18n directory) plugins contain localized texts
468 (a.k.a. translations). A number of languages is provided.
469
470 Included regionals:
471 * ``de`` German (Deutsch).
282a01b @vanderlee Greece translation by Vagelis, through Transifex
authored
472 * ``el`` Greece.
920ca14 Added parser and writer plugins
Martijn authored
473 * ``en`` English (default).
282a01b @vanderlee Greece translation by Vagelis, through Transifex
authored
474 * ``fr`` French.
475 * ``nl`` Dutch.
920ca14 Added parser and writer plugins
Martijn authored
476 * ``pt-br`` Brazilian Portuguese.
7acbc4e @vanderlee Improved documentation
authored
477 * ``ru`` Russian.
920ca14 Added parser and writer plugins
Martijn authored
478
c74cbb8 Added parser and writer plugins
Martijn authored
479 ### swatches
480 Swatches are collections of predefined and named colors. By default the
920ca14 Added parser and writer plugins
Martijn authored
481 standard ``html`` colors are loaded.
7acbc4e @vanderlee Improved documentation
authored
482 Setting `swatches` using the `option` method will switch the displayed swatches.
920ca14 Added parser and writer plugins
Martijn authored
483
484 Included plugins:
485 * ``crayola`` Crayola pencil color names
486 * ``pantone`` Pantone color codes
487 * ``ral-classic`` Classic RAL paint numbers
7acbc4e @vanderlee Improved documentation
authored
488 * ``x11`` X11 color palette (using "gray", not "grey").
5a8cf29 parser plugins
Martijn authored
489
c74cbb8 Added parser and writer plugins
Martijn authored
490 ### writers
a248387 Added revert.
Martijn authored
491 Writers take a Color object and output a textual representation of the color.
492 Writers are used for the colorFormat option.
5a8cf29 parser plugins
Martijn authored
493
920ca14 Added parser and writer plugins
Martijn authored
494 No plugins included.
5a8cf29 parser plugins
Martijn authored
495
496 Objects
497 -------
498 Colorpicker uses a Color object internally to represent a color and convert
499 between the supported color models.
a7c32fb Fix for #80: New option 'containment'.
Pablo Gra\~na authored
500 You can create a new Color object through $.colorpicker.Color.
Something went wrong with that request. Please try again.