forked from felipegruoso/materialize-colorpicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1042 lines (953 loc) · 33.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Colorpicker for MaterializeCSS</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.99.0/css/materialize.min.css">
<link rel="stylesheet" href="dist/css/materialize-colorpicker.min.css">
<link rel="stylesheet" href="src/css/docs.css">
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<!-- NavBar -->
<div class="navbar-fixed">
<nav>
<div class="container">
<a href="#" class="brand-logo"><i class="material-icons">camera</i> Materialize ColorPicker 1.0</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="#about">About</a></li>
<li><a href="#examples">Examples</a></li>
<li><a href="#documentation">Documentation</a></li>
</ul>
</div>
</nav>
</div>
<!-- NavBar -->
<!-- Content -->
<div class="container">
<!-- Title -->
<section id="about">
<div class="row">
<div class="col s12 m9 l10">
<h3 class="header">Materialize Colorpicker 1.0 <span class="small-header">for MaterializeCSS</span></h3>
</div>
</div>
</section>
<!-- Title -->
<!-- About -->
<section>
<div class="row">
<p>
Colorpicker plugin for MaterializeCSS toolkit. Originally written by <a
href="https://twitter.com/stefanpetre/" target="_blank">@eyecon</a>, forked from
<a href="http://twitter.com/mjolnic/" target="_blank">@mjolnic</a> and maintened by <a href="https://github.com/felipegruoso" target="_blank">felipegruoso</a>.
<br>
<br> It basically adds a color picker to a field or any other element.
</p>
<blockquote class="bq">Can be used as a component;</blockquote>
<blockquote class="bq">Has alpha picker;</blockquote>
<blockquote class="bq">Supports multiple formats: HEX, RGB, RGBA, HSL, HSLA.</blockquote>
</div>
<div class="row">
<a href="https://github.com/mjolnic/bootstrap-colorpicker/" target="_blank"
class="btn btn-default btn-md"><i class="glyphicon glyphicon-random"></i> Fork Original Source</a>
<a href="https://github.com/felipegruoso/bootstrap-colorpicker/" target="_blank"
class="btn btn-default btn-md"><i class="glyphicon glyphicon-random"></i> Fork me on Github</a>
<a href="https://github.com/felipegruoso/bootstrap-colorpicker/archive/master.zip" target="_blank"
class="btn btn-success btn-md"><i class="glyphicon glyphicon-download-alt"></i> Download</a>
</div>
</section>
<!-- About -->
<!-- Examples -->
<section id="examples">
<div class="row">
<div class="col s12 m9 l10">
<h3 class="header">Examples</h3>
</div>
<div class="col s12">
<p>Attached to a field with hex format specified via options:</p>
<div class="row">
<!-- Demo 1 -->
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a class="active" href="#demo1-example">Demo</a></li>
<li class="tab col s3"><a href="#demo1-html">HTML</a></li>
<li class="tab col s3"><a href="#demo1-js">JavaScript</a></li>
</ul>
</div>
<div id="demo1-example" class="col s12">
<div class="col s6">
<input type="text" id="demo1" value="#5367ce" />
</div>
</div>
<div id="demo1-html" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<input type="text" id="demo1" value="#5367ce" />
</code>
</pre>
</div>
</div>
</div>
<div id="demo1-js" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<script>
$(function() {
$('.demo1').colorpicker();
});
</script>
</code>
</pre>
</div>
</div>
</div>
<!-- Demo 1 -->
</div>
<p>As a component:</p>
<div class="row">
<!-- Demo component -->
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a class="active" href="#demo-component-example">Demo</a></li>
<li class="tab col s3"><a href="#demo-component-html">HTML</a></li>
<li class="tab col s3"><a href="#demo-component-js">JavaScript</a></li>
</ul>
</div>
<div id="demo-component-example" class="col s12">
<div class="col s12 demo-padding">
<div id="demo-component" class="file-field">
<div class="btn"></div>
<div class="file-path-wrapper">
<input type="text" />
</div>
</div>
</div>
</div>
<div id="demo-component-html" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<div id="demo-component" class="file-field">
<div class="btn"></div>
<div class="file-path-wrapper">
<input type="text" />
</div>
</div>
</code>
</pre>
</div>
</div>
</div>
<div id="demo-component-js" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<script>
$(function() {
$('#demo-component').colorpicker({
component: '.btn'
});
});
</script>
</code>
</pre>
</div>
</div>
</div>
<!-- Demo component -->
</div>
<p>Using events to work with the color:
<div class="row">
<!-- Demo 2 -->
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a class="active" href="#demo2-example">Demo</a></li>
<li class="tab col s3"><a href="#demo2-html">HTML</a></li>
<li class="tab col s3"><a href="#demo2-js">JavaScript</a></li>
</ul>
</div>
<div id="demo2-example" class="col s12">
<div class="col s12 demo-padding">
<a href="#" id="demo2">Changes this text background color</a>.<p>
</div>
</div>
<div id="demo2-html" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<input type="text" class="demo1" value="#5367ce" />
</code>
</pre>
</div>
</div>
</div>
<div id="demo2-js" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<script>
$(function() {
$('#demo2').colorpicker({
// Alpha is not supported for some html elements.
format: 'rgb'
// Gets the actual background color
color: $('#demo2').css('background-color')
}).on('changeColor', function(ev) {
// Sets the new color while it is changing.
$(this).css('background-color',ev.color.toHex());
});
});
</script>
</code>
</pre>
</div>
</div>
</div>
<!-- Demo 2 -->
</div>
<p>Transparent color support:</p>
<div class="row">
<!-- Demo 3 -->
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a class="active" href="#demo3-example">Demo</a></li>
<li class="tab col s3"><a href="#demo3-html">HTML</a></li>
<li class="tab col s3"><a href="#demo3-js">JavaScript</a></li>
</ul>
</div>
<div id="demo3-example" class="col s12">
<div class="col s6">
<input type="text" data-format="hex" class="demo-auto colorpicker-element" id="demo3" value="transparent">
</div>
</div>
<div id="demo3-html" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<input type="text" id="demo3" />
</code>
</pre>
</div>
</div>
</div>
<div id="demo3-js" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<script>
$(function() {
$('#demo3').colorpicker({
format: 'hex',
color: 'transparent'
});
});
</script>
</code>
</pre>
</div>
</div>
</div>
<!-- Demo 3 -->
</div>
<p>Horizontal mode:</p>
<div class="row">
<!-- Demo 4 -->
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a class="active" href="#demo4-example">Demo</a></li>
<li class="tab col s3"><a href="#demo4-html">HTML</a></li>
<li class="tab col s3"><a href="#demo4-js">JavaScript</a></li>
</ul>
</div>
<div id="demo4-example" class="col s12">
<div class="col s6">
<input type="text" id="demo4" value="#8fff00">
</div>
</div>
<div id="demo4-html" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<input type="text" id="demo4" value="#8fff00" />
</code>
</pre>
</div>
</div>
</div>
<div id="demo4-js" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<script>
$(function() {
$('#demo4').colorpicker({
horizontal: true
});
});
</script>
</code>
</pre>
</div>
</div>
</div>
<!-- Demo 3 -->
</div>
<p>Inline mode:</p>
<div class="row">
<!-- Demo 5 -->
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a class="active" href="#demo5-example">Demo</a></li>
<li class="tab col s3"><a href="#demo5-html">HTML</a></li>
<li class="tab col s3"><a href="#demo5-js">JavaScript</a></li>
</ul>
</div>
<div id="demo5-example" class="col s12">
<div class="col s12 demo-padding">
<div id="demo5-1" class="inl-bl" data-container="#demo5-1" data-color="rgba(238,110,115,1)" data-inline="true"></div>
<div id="demo5-2" class="inl-bl" data-container="true" data-color="rgba(38,166,154,1)" data-inline="true"></div>
<div id="demo5-3" class="inl-bl"></div>
</div>
</div>
<div id="demo5-html" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<!-- HTML parameters-->
<div id="demo5-1" class="inl-bl" data-container="#demo5-1" data-color="rgba(238,110,115,1)" data-inline="true"></div>
<div id="demo5-2" class="inl-bl" data-container="true" data-color="rgba(38,166,154,1)" data-inline="true"></div>
<!-- Javascript parameters -->
<div id="demo5-3" class="inl-bl"></div>
</code>
</pre>
</div>
</div>
</div>
<div id="demo5-js" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<script>
$(function() {
$('#demo5-1').colorpicker();
$('#demo5-2').colorpicker();
$('#demo5-3').colorpicker({
container: true,
color: "rgba(100, 181, 246)",
inline: true
});
});
</script>
</code>
</pre>
</div>
</div>
</div>
<!-- Demo 5 -->
</div>
<p>Materialize colors:</p>
<div class="row">
<!-- Demo 6 -->
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a class="active" href="#demo6-example">Demo</a></li>
<li class="tab col s3"><a href="#demo6-html">HTML</a></li>
<li class="tab col s3"><a href="#demo6-js">JavaScript</a></li>
</ul>
</div>
<div id="demo6-example" class="col s12">
<div class="col s6 demo-padding">
<input type="text" id="demo6">
</div>
</div>
<div id="demo6-html" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<input type="text" id="demo6" />
</code>
</pre>
</div>
</div>
</div>
<div id="demo6-js" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<script>
$(function() {
$('#demo6').colorpicker({
colorSelectors: {
'red': '#f44336',
'pink': '#e91e63',
'purple': '#9c27b0',
'deep-purple': '#673ab7',
'indigo': '#3f51b5',
'blue': '#2196f3',
'light-blue': '#03a9f4',
'cyan': '#00bcd4',
'teal': '#009688',
'green': '#4caf50',
'light-green': '#8bc34a',
'lime': '#cddc39',
'yellow': '#ffeb3b',
'amber': '#ffc107',
'orange': '#ff9800',
'deep-orange': '#ff5722',
'brown': '#795548',
'grey': '#9e9e9e',
'blue-grey': '#607d8b',
'black': '#000000',
'white': '#ffffff'
},
format: 'hex',
color: 'green'
});
});
</script>
</code>
</pre>
</div>
</div>
</div>
<!-- Demo 6 -->
</div>
<p>Custom size:</p>
<div class="row">
<!-- Demo 7 -->
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a class="active" href="#demo7-example">Demo</a></li>
<li class="tab col s3"><a href="#demo7-html">HTML</a></li>
<li class="tab col s3"><a href="#demo7-js">JavaScript</a></li>
<li class="tab col s3"><a href="#demo7-css">CSS</a></li>
</ul>
</div>
<div id="demo7-example" class="col s12">
<div class="col s6 demo-padding">
<input type="text" id="demo7" />
</div>
</div>
<div id="demo7-html" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<input type="text" id="demo7" />
</code>
</pre>
</div>
</div>
</div>
<div id="demo7-js" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<script>
$(function() {
$('#demo7').colorpicker({
color: '#ffaa00',
customClass: 'colorpicker-2x',
sliders: {
saturation: {
maxLeft: 200,
maxTop: 200
},
hue: {
maxTop: 200
},
alpha: {
maxTop: 200
}
}
});
});
</script>
</code>
</pre>
</div>
</div>
</div>
<div id="demo7-css" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<style>
.colorpicker-2x .colorpicker-saturation {
width: 200px;
height: 200px;
}
.colorpicker-2x .colorpicker-hue,
.colorpicker-2x .colorpicker-alpha {
width: 30px;
height: 200px;
}
.colorpicker-2x .colorpicker-color,
.colorpicker-2x .colorpicker-color div{
height: 30px;
}
</style>
</code>
</pre>
</div>
</div>
</div>
<!-- Demo 7 -->
</div>
<p>Enabled / Disabled:</p>
<div class="row">
<!-- Demo 8 -->
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a class="active" href="#demo8-example">Demo</a></li>
<li class="tab col s3"><a href="#demo8-html">HTML</a></li>
<li class="tab col s3"><a href="#demo8-js">JavaScript</a></li>
</ul>
</div>
<div id="demo8-example" class="col s12">
<div class="col s6 demo-padding">
<input type="text" id="demo8" />
</div>
<div class="col s6">
<a id="demo-enable" class="waves-effect waves-light btn"><i class="material-icons left">done</i>enable</a>
<a id="demo-disable" class="waves-effect waves-light btn red"><i class="material-icons left">clear</i>disable</a>
</div>
</div>
<div id="demo8-html" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<input type="text" id="demo8" />
<a id="demo-enable" class="waves-effect waves-light btn"><i class="material-icons left">done</i>enable</a>
<a id="demo-disable" class="waves-effect waves-light btn red"><i class="material-icons left">clear</i>disable</a>
</code>
</pre>
</div>
</div>
</div>
<div id="demo8-js" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<script>
$(function() {
$('#demo8').colorpicker();
// Handles the demo 8 disable button.
$("#demo-disable").click(function(e) {
e.preventDefault();
$("#demo8").colorpicker('disable');
});
// Handles the demo 8 enable button.
$("#demo-enable").click(function(e) {
e.preventDefault();
$("#demo8").colorpicker('enable');
});
});
</script>
</code>
</pre>
</div>
</div>
</div>
<!-- Demo 8 -->
</div>
<p>Materialize modal:</p>
<div class="row">
<!-- Demo 9 -->
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a class="active" href="#demo9-example">Demo</a></li>
<li class="tab col s3"><a href="#demo9-html">HTML</a></li>
<li class="tab col s3"><a href="#demo9-js">JavaScript</a></li>
</ul>
</div>
<div id="demo9-example" class="col s12">
<div class="col s12 demo-padding">
<a href="#modal1" class="waves-effect waves-light btn modal-trigger">open modal</a>
<!-- Modal -->
<div id="modal1" class="modal">
<div class="modal-content">
<h4>Colospicker inside modal</h4>
<input type="text" id="demo9-1">
</div>
<div class="modal-footer">
<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Agree</a>
</div>
</div>
<!-- Modal -->
</div>
</div>
<div id="demo9-html" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<a href="#modal1" class="waves-effect waves-light btn modal-trigger">open modal</a>
<!-- Modal -->
<div id="modal1" class="modal">
<div class="modal-content">
<h4>Colospicker inside modal</h4>
<input type="text" id="demo9-1">
</div>
<div class="modal-footer">
<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Agree</a>
</div>
</div>
</code>
</pre>
</div>
</div>
</div>
<div id="demo9-js" class="col s12">
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<script>
$(function() {
$('#demo9-1').colorpicker();
});
</script>
</code>
</pre>
</div>
</div>
</div>
<!-- Demo 9 -->
</div>
</div>
</div>
</section>
<!-- Examples -->
<!-- Documentation -->
<section id="documentation">
<div class="col s12 m9 l10">
<h3 class="header">Documentation</h3>
</div>
<div class="col s12">
<div class="row">
<p>Call the colopicker via javascript:</p>
<div class="card">
<div class="card-content">
<pre>
<code class="language-markup">
<script>
$(function(){
$('.sample-selector').colorpicker({ /*options...*/ });
});
</script>
</code>
</pre>
</div>
</div>
</div>
<div class="row">
<h5 class="header">Options</h5>
<p>You can set colorpicker options either as a plugin parameter or data-* attributes</p>
<table class="striped">
<thead>
<tr>
<th>Name</th>
<th style="width: 200px;">Type</th>
<th style="width: 200px;">Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>format</td>
<td>string</td>
<td>false</td>
<td>If not false, forces the color format to be hex, rgb or rgba, otherwise the format is
automatically detected.
</td>
</tr>
<tr>
<td>color</td>
<td>string</td>
<td>false</td>
<td>If not false, sets the color to this value.</td>
</tr>
<tr>
<td>container</td>
<td>string or jQuery Element</td>
<td>false</td>
<td>If not false, the picker will be contained inside this element, otherwise it will be
appended to the document body.
</td>
</tr>
<tr>
<td>component</td>
<td>string or jQuery Element</td>
<td>'.add-on, .input-group-addon'</td>
<td>Children selector for the component or element that trigger the colorpicker and which
background color will change (needs an inner <i> element).
</td>
</tr>
<tr>
<td>input</td>
<td>string or jQuery Element</td>
<td>'input'</td>
<td>Children selector for the input that will store the picker selected value.</td>
</tr>
<tr>
<td>horizontal</td>
<td>boolean</td>
<td>false</td>
<td>If true, the hue and alpha channel bars will be rendered horizontally, above the saturation
selector.
</td>
</tr>
<tr>
<td>inline</td>
<td>boolean</td>
<td>false</td>
<td>If true, forces to show the colorpicker as an inline element.</td>
</tr>
<tr>
<td>sliders</td>
<td>object</td>
<td><abbr title="please, read the source code to see this value">[...]</abbr></td>
<td>Vertical sliders configuration (read source code if you really need to tweak this).</td>
</tr>
<tr>
<td>slidersHorz</td>
<td>object</td>
<td><abbr title="please, read the source code to see this value">[...]</abbr></td>
<td>Horizontal sliders configuration (read source code if you really need to tweak this).</td>
</tr>
<tr>
<td>template</td>
<td>string</td>
<td><abbr title="please, read the source code to see this value">[...]</abbr></td>
<td>Customizes the default colorpicker HTML template.</td>
</tr>
<tr>
<td>align</td>
<td>string</td>
<td>'right'</td>
<td>By default, the colorpicker is aligned to the right of the input. If you need to switch it
to the left, set align to 'left'.
</td>
</tr>
<tr>
<td>customClass</td>
<td>string</td>
<td>null</td>
<td>Adds this class to the colorpicker widget.</td>
</tr>
<tr>
<td>colorSelectors</td>
<td>object</td>
<td>null</td>
<td>List of pre selected colors (hex format). If you choose one of these colors, the alias is returned instead of the hex code.</td>
</tr>
</tbody>
</table>
</div>
<div class="row">
<h5 class="header">jQuery API Methods</h5>
<p>General usage methods</p>
<table class="striped">
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><b>.colorpicker(options)</b></td>
<td><p>Initializes an colorpicker.</p></td>
</tr>
<td><b>.colorpicker('getValue', defaultValue)</b></td>
<td><p>Gets the value from the input or the data attribute (if has no input), otherwise returns the default value, which defaults to #000000 if not specified.</p></td>
</tr>
<tr>
<td><b>.colorpicker('setValue', value)</b></td>
<td><p>Set a new value for the color picker (also updates everything). Triggers 'changeColor' event.</p></td>
</tr>
<tr>
<td><b>.colorpicker('show')</b></td>
<td><p>Show the color picker.</p></td>
</tr>
<tr>
<td><b>.colorpicker('hide')</b></td>
<td><p>Hide the color picker.</p></td>
</tr>
<tr>
<td><b>.colorpicker('reposition')</b></td>
<td><p>Updates the color picker's position relative to the element.</p></td>
</tr>
<tr>
<td><b>.colorpicker('update')</b></td>
<td><p>Refreshes the widget colors (this is done automatically).</p></td>
</tr>
<tr>
<td><b>.colorpicker('enable')</b></td>
<td><p>Enable the color picker.</p></td>
</tr>
<tr>
<td><b>.colorpicker('disable')</b></td>
<td><p>Disable the color picker.</p></td>
</tr>
<tr>
<td><b>.colorpicker('destroy')</b></td>
<td><p>Destroys the colorpicker widget and unbind all .colorpicker events from the element and component.</p></td>
</tr>
<tr>
<td><b>.data('colorpicker')</b></td>
<td><p>Access to the colorpicker API directly.</p></td>
</tr>
<tr>
<td><b>.data('colorpicker').color</b></td>
<td><p>Access to the colorpicker Color object information.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="row">
<h5 class="header">Color object methods</h5>
<p>Each triggered events have a color object (avaliable through event.color, see the example at the bottom) used internally by the picker. This object has several useful methods. These are the more commonly used:</p>
<table class="striped">
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><b>.setColor(value)</b></td>
<td><p>Set a new color. The value is parsed and tries to do a quess on the format.</p></td>
</tr>
<tr>
<td><b>.setHue(value)</b></td>
<td><p>Set the HUE with a value between 0 and 1.</p></td>
</tr>
<tr>
<td><b>.setSaturation(value)</b></td>
<td><p>Set the saturation with a value between 0 and 1.</p></td>
</tr>
<tr>
<td><b>.setBrightness(value)</b></td>
<td><p>Set the brightness with a value between 0 and 1.</p></td>
</tr>
<tr>
<td><b>.setAlpha(value)</b></td>
<td><p>Set the transparency with a value between 0 and 1.</p></td>
</tr>
<tr>
<td><b>.toRGB()</b></td>
<td><p>Returns a hash with red, green, blue and alpha.</p></td>
</tr>
<tr>
<td><b>.toHex()</b></td>
<td><p>Returns a string with HEX format for the current color.</p></td>
</tr>
<tr>
<td><b>.toHSL()</b></td>
<td><p>Returns a hash with HSLA values.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="row">
<h5 class="header">Events</h5>
<table class="striped">
<thead>
<tr>
<th style="width: 150px;">Event</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>create</td>
<td>This event fires immediately when the color picker is created.</td>
</tr>
<tr>
<td>showPicker</td>
<td>This event fires immediately when the color picker is displayed.</td>
</tr>
<tr>
<td>hidePicker</td>
<td>This event is fired immediately when the color picker is hidden.</td>
</tr>
<tr>
<td>changeColor</td>
<td>This event is fired when the color is changed.</td>
</tr>
<tr>
<td>disable</td>
<td>This event is fired immediately when the color picker is disabled, except if it was
initialized as disabled.
</td>
</tr>
<tr>
<td>enable</td>
<td>This event is fired immediately when the color picker is enabled, except upon
initialization.
</td>
</tr>
<tr>
<td>destroy</td>
<td>This event fires immediately when the color picker is destroyed.</td>