-
-
Notifications
You must be signed in to change notification settings - Fork 127
/
index.html
407 lines (374 loc) · 12.6 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
<!DOCTYPE html>
<html lang="en">
<head>
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-063933E3C2"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-063933E3C2");
</script>
<title>ColorPicker</title>
<link rel="canonical" href="https://evoluteur.github.io/colorpicker/" />
<meta charset="utf-8" />
<meta
name="description"
content="Evol-ColorPicker: a web color picker which looks like the one in Microsoft Office 2010."
/>
<meta
name="keywords"
content="jQuery, UI, widget, plugin, colorpicker, color, picker, palette, input, web, microsoft, office"
/>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="icon" type="image/png" href="favicon.gif" />
<meta
property="og:title"
content="evol-colorpicker: jQuery UI widget for color picking with web colors, theme colors, and history (similar to the one in Microsoft Office 2010)."
/>
<meta
property="og:url"
content="https://evoluteur.github.io/colorpicker/"
/>
<meta
property="og:image"
content="https://raw.github.com/evoluteur/colorpicker/master/screenshot2.png"
/>
<link
id="jquiCSS"
rel="stylesheet"
href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/base/jquery-ui.css"
type="text/css"
media="all"
/>
<link href="css/demo.css" rel="stylesheet" />
<link href="css/evol-colorpicker.min.css" rel="stylesheet" />
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"
type="text/javascript"
></script>
<script
src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"
type="text/javascript"
></script>
<script src="js/evol-colorpicker.min.js" type="text/javascript"></script>
</head>
<body>
<header>
<h1 id="title">Evol-ColorPicker <span>v3.4.3</span></h1>
<nav>
<a href="index.html">Demo</a>
<a href="documentation.html">Documentation</a>
</nav>
<div id="github">
<iframe
src="https://ghbtns.com/github-btn.html?user=evoluteur&type=star&count=true&size=small&repo=colorpicker"
frameborder="0"
scrolling="0"
width="100px"
height="30px"
></iframe>
</div>
</header>
<section>
<p>
<strong>Evol-ColorPicker</strong> is a web color picker which looks like
the one in Microsoft Office 2010.
</p>
<p>
It can be used inline or as a popup bound to a text box. It comes with
several color palettes, can track selection history and supports
"transparent" color. It is a full jQuery UI widget, supporting various
configurations and themes.
</p>
<p>
Open Source at GitHub:
<a href="https://github.com/evoluteur/colorpicker"
>evoluteur/colorpicker</a
>
</p>
<div>
<p>
Themes: <a href="#" class="css sel">Base</a> -
<a href="#" class="css">UI lightness</a> -
<a href="#" class="css">UI darkness</a> -
<a href="#" class="css">Redmond</a> -
<a href="#" class="css">Sunny</a> -
<a href="#" class="css">Le Frog</a> -
<a href="#" class="css">Swanky Purse</a>
</p>
<div>
<div class="demoPanel">
Inline (using a DIV tag):<br /><br />
<div id="cpInline"></div>
<br />
<div class="demo-links">
<a href="#" id="getVal2">Get Value</a>
<a href="#" id="setVal2">Set Value</a><br />
<a href="#" id="enable2">Enable</a>
<a href="#" id="disable2">Disable</a>
<a href="#" id="destroy2">Destroy</a>
</div>
</div>
<div class="demoPanel">
Inline with "web" default palette:<br /><br />
<div id="cpInline2"></div>
</div>
<div
class="demoPanel ui-widget ui-widget-content ui-corner-all"
style="width: 130px"
>
Palette triggers:<br /><br />
<label>button only</label>
<input id="cpButton" value="#ccc1d9" />
<label>focus only</label>
<input id="cpFocus" value="#8db3e2" />
<label>button + focus</label>
<input id="cpBoth" value="#b7dde8" />
<label><a href="#" id="show">link</a></label>
<input id="cpOther" value="#d7e3bc" />
<br />
<i>Using "showOn" option.</i>
</div>
<span class="clearer"></span>
</div>
<div>
<div id="cpb" class="demoPanel" style="width: 170px">
Methods:<br /><br />
<input id="cp1" /><br />
<div id="tests" class="demo-links">
<a href="#" id="getVal">Get Value</a>
<a href="#" id="setVal">Set Value</a><br />
<a href="#" id="enable">Enable</a>
<a href="#" id="disable">Disable</a>
<a href="#" id="clear">Clear</a>
<a href="#" id="destroy1">Destroy</a>
</div>
</div>
<div
id="cpEvent"
class="demoPanel"
style="width: 170px; background-color: #ebf1dd"
>
Event binding:
<br /><br />
<input id="cpBinding" /><br />
<i>Using "change.color" and "mouseover.color" events.</i>
</div>
<div class="demoPanel">
Custom Palette:<br />
<br />
<div id="customTheme" value="#92cddc"></div>
<br />
<i
>Using the "customTheme" option you can provide your own list of
colors.</i
>
</div>
<span class="clearer"></span>
</div>
<div
class="demoPanel ui-widget ui-widget-content ui-corner-all"
style="width: 130px"
>
With transparent color:
<br /><br />
<input id="transColor" value="#0000ffff" />
</div>
<div
class="demoPanel ui-widget ui-widget-content ui-corner-all"
style="width: 130px"
>
Using "hideButton" option:<br />
<br />
<input id="hideButton" value="#92cddc" />
</div>
<div
class="demoPanel ui-widget ui-widget-content ui-corner-all"
style="width: 130px"
>
No color indicator on the palette:<br />
<br />
<input id="noIndColor" value="#92cddc" />
</div>
<div
class="demoPanel ui-widget ui-widget-content ui-corner-all"
style="width: 130px"
>
In French:<br />
<br />
<input id="frenchColor" value="#92cddc" /><br />
<i>Using the "strings" option you can translate the colorpicker.</i>
</div>
<span class="clearer"></span>
</div>
<script>
$(document).ready(function () {
// Change theme
$(".css").on("click", function (evt) {
var theme = this.innerHTML.toLowerCase().replace(" ", "-"),
url =
"https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/" +
theme +
"/jquery-ui.css";
$("#jquiCSS").attr("href", url);
$(".css").removeClass("sel");
$(this).addClass("sel");
});
// Events demo
function setColor(evt, color) {
if (color) {
$("#cpEvent").css("background-color", color);
}
}
$("#cpBinding")
.colorpicker({
color: "#ebf1dd",
initialHistory: ["#ff0000", "#000000", "red", "purple"],
})
.on("change.color", setColor)
.on("mouseover.color", setColor);
// Methods demo
$("#getVal").on("click", function () {
alert('Selected color = "' + $("#cp1").colorpicker("val") + '"');
});
$("#setVal").on("click", function () {
$("#cp1").colorpicker("val", "#31859b");
});
$("#enable").on("click", function () {
$("#cp1").colorpicker("enable");
});
$("#disable").on("click", function () {
$("#cp1").colorpicker("disable");
});
$("#clear").on("click", function () {
$("#cp1").colorpicker("clear");
});
$("#destroy1").on("click", function () {
$("#cp1").colorpicker("destroy");
});
// Methods demo 2 (inline colorpicker)
$("#getVal2").on("click", function () {
alert(
'Selected color = "' + $("#cpInline").colorpicker("val") + '"'
);
});
$("#setVal2").on("click", function () {
$("#cpInline").colorpicker("val", "#31859b");
});
$("#enable2").on("click", function () {
$("#cpInline").colorpicker("enable");
});
$("#disable2").on("click", function () {
$("#cpInline").colorpicker("disable");
});
$("#destroy2").on("click", function () {
$("#cpInline").colorpicker("destroy");
});
// Instanciate colorpickers
$("#cp1").colorpicker({
color: "#ff9800",
initialHistory: ["#ff0000", "#000000", "red", "purple"],
});
$("#cpBinding").colorpicker({
color: "#ebf1dd",
});
$("#cpInline").colorpicker({ color: "#92cddc" });
$("#cpInline2").colorpicker({
color: "#92cddc",
defaultPalette: "web",
});
// Custom theme palette
$("#customTheme").colorpicker({
color: "#f44336",
customTheme: [
"#f44336",
"#ff9800",
"#ffc107",
"#4caf50",
"#00bcd4",
"#3f51b5",
"#9c27b0",
"white",
"black",
],
});
$("#cpButton").colorpicker({ showOn: "button" });
$("#cpFocus").colorpicker({ showOn: "focus" });
$("#cpBoth").colorpicker();
$("#cpOther").colorpicker({ showOn: "none" });
$("#show").on("click", function (evt) {
evt.stopImmediatePropagation();
$("#cpOther").colorpicker("showPalette");
});
// With transparent color
$("#transColor").colorpicker({
transparentColor: true,
});
// With hidden button
$("#hideButton").colorpicker({
hideButton: true,
});
// No color indicator
$("#noIndColor").colorpicker({
displayIndicator: false,
});
// French colorpicker
$("#frenchColor").colorpicker({
strings:
"Couleurs de themes,Couleurs de base,Plus de couleurs,Moins de couleurs,Palette,Historique,Pas encore d'historique.",
});
// Fix links
$('a[href="#"]').attr("href", "javascript:void(0)");
});
</script>
<p>
<br /><a
href="https://github.com/evoluteur/colorpicker/archive/master.zip"
>Download</a
>,
<a href="https://github.com/evoluteur/colorpicker/issues"
>feature requests</a
>
and
<a href="https://github.com/evoluteur/colorpicker/issues"
>bugs report</a
>
are available at
<a href="https://github.com/evoluteur/colorpicker" target="download"
>GitHub</a
>.
</p>
<p>
Evol-ColorPicker is released under the
<a href="http://github.com/evoluteur/colorpicker/raw/master/LICENSE.md"
>MIT license</a
>
(<a
href="https://npm-stat.com/charts.html?package=evol-colorpicker&from=2016-01-01&to=2023-12-31"
>50,000 downloads</a
>
on NPM in 2023).
</p>
<div>
Check out my other jQuery UI widget
<a href="https://evoluteur.github.io/structured-filter"
>structured-filter</a
>.
</div>
<div class="evo-footer" role="contentinfo">
<div>
Made in California with
<div class="heart">♥</div>
</div>
</div>
<p>
© 2024 <a href="https://evoluteur.github.io/">Olivier Giulieri</a>
</p>
</section>
</body>
</html>