-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
78 lines (72 loc) · 2.66 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta property="og:site_name" content="Colr">
<meta property="og:title" content="Colr - Eitan Biletski" />
<meta property="og:description" content="Colr is a nano internet tool made by Eitan Biletski in 2 days." />
<meta property="og:image:secure_url" itemprop="image" content="https://raw.githubusercontent.com/TEnLOcODE/colr/main/57573928-1e78db80-7430-11e9-940c-aecbf3226b7c%20(1).png">
<meta property="og:type" content="website" />
<meta property="og:image:width" content="256">
<meta property="og:image:height" content="256">
<meta property="og:image:type" content="image/png">
<meta property="og:url" content="https://tenlocode.github.io/colr">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Colr - Eitan Biletski</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/themes/classic.min.css"/>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="bg" id="bg">
<div class="color-picker"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/pickr.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/pickr.es5.min.js"></script>
<script>
let bg = document.getElementById("bg");
const pickr = Pickr.create({
el: '.color-picker',
theme: 'classic', // or 'monolith', or 'nano'
swatches: [
'rgba(244, 67, 54, 1)',
'rgba(233, 30, 99, 0.95)',
'rgba(156, 39, 176, 0.9)',
'rgba(103, 58, 183, 0.85)',
'rgba(63, 81, 181, 0.8)',
'rgba(33, 150, 243, 0.75)',
'rgba(3, 169, 244, 0.7)',
'rgba(0, 188, 212, 0.7)',
'rgba(0, 150, 136, 0.75)',
'rgba(76, 175, 80, 0.8)',
'rgba(139, 195, 74, 0.85)',
'rgba(205, 220, 57, 0.9)',
'rgba(255, 235, 59, 0.95)',
'rgba(255, 193, 7, 1)'
],
components: {
// Main components
preview: true,
opacity: true,
hue: true,
// Input / output Options
interaction: {
hex: true,
rgba: true,
hsla: true,
hsva: true,
cmyk: true,
input: true,
clear: false,
save: true
}
}
});
pickr.on('change', (...args) => {
let color = args[0].toRGBA();
console.log(color);
this.bg.style.backgroundColor = `rgba(${color[0]},${color[1]},${color[2]},${color[3]})`;
})
</script>
</body>
</html>