-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolorpicker.html
137 lines (128 loc) · 3.38 KB
/
colorpicker.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Color-Picker</title>
</head>
<body></body>
</html>
<html>
<head>
<title>colorPicker</title>
<style>
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
#container {
width: 500px;
height: 400px;
/* border:2px solid black; */
margin-top: 100px;
margin-left: 500px;
box-shadow: 10px 10px 4px grey;
border-radius: 10px;
}
#header {
width: inherit;
height: 50px;
text-align: center;
font-family: cursive;
color: rgb(123, 220, 148);
font-size: 200%;
}
#colorDiv {
width: inherit;
height: 50px;
background-color: rgb(123, 220, 148);
text-align: center;
font-family: cursive;
color: white;
font-size: 200%;
padding: 10px;
}
#content {
margin-left: 150px;
padding: 20px;
color: rgb(123, 220, 148);
}
</style>
</head>
<body style="background-color:black" ;>
<div id="container">
<div id="header">Color@Picker</div>
<div id="colorDiv">
rgb(<span id="redCode">123</span>, <span id="greenCode">220</span>,
<span id="blueCode">148</span> )
</div>
<div id="content">
<input
type="range"
value="123"
;
min="0"
max="255"
id="red"
oninput="controller()"
;
onchange="controller()"
;
/>
<br />Red<br />
<input
type="range"
value="220"
min="0"
max="255"
id="green"
oninput="controller()"
;
onchange="controller()"
;
/>
<br />Green<br />
<input
type="range"
value="148"
min="0"
max="255"
id="blue"
oninput="controller()"
;
onchange="controller()"
;
/>
<br />Blue<br />
</div>
</div>
<script>
function controller() {
var red = document.getElementById('red').value;
var green = document.getElementById('green').value;
var blue = document.getElementById('blue').value;
document.getElementById('redCode').innerHTML = red;
document.getElementById('greenCode').innerHTML = green;
document.getElementById('blueCode').innerHTML = blue;
document.getElementById(
'colorDiv'
).style.backgroundColor = `rgb(${red}, ${green}, ${blue})`;
document.getElementById(
'container'
).style.boxShadow = `10px 10px 8px rgb(${red} , ${green} , ${blue})`;
document.getElementById(
'header'
).style.color = `rgb(${red} , ${green} , ${blue})`;
document.getElementById(
'content'
).style.color = `rgb(${red} , ${green} , ${blue})`;
}
// if(navigator.onLine)
// alert("online");
// else
// alert("offline");
</script>
</body>
</html>