View difference between Paste ID: chx5HeBW and eRhUS48c
SHOW: | | - or go back to the newest paste.
1
<html>
2
<head>
3
<script>
4
function colorCh(input) {
5
color=input.value;
6
power= 
7
 parseInt(color.substr(0,2),16)
8
+parseInt(color.substr(2,2),16)
9
+parseInt(color.substr(4,2),16);
10
input.style.background = color;
11
if (power>256*1.5)
12
{
13
   input.style.color = "000000";
14
}
15
else
16
{
17
   input.style.color = "FFFFFF";
18
}
19
return;
20
}
21
</script>
22
</head>
23
<body>
24
<form action="/post" method="postp" enctype="application/x-www-form-urlencoded" style="font-family:courier;">
25
__
26
<input type="text" size="12" value="R G B" style="font-family:courier;" readonly>
27
<br>
28
00
29
<input type="text" size="12" value="FF00FF" onchange="colorCh(this)" style="background-color:#FF00FF;font-family:courier;">
30
<br>
31
<input type="submit" value="Submit">
32
</form>
33
</body>
34
</html>