Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- function colorCh(input) {
- color=input.value;
- power=
- parseInt(color.substr(0,2),16)
- +parseInt(color.substr(2,2),16)
- +parseInt(color.substr(4,2),16);
- input.style.background = color;
- if (power>256*1.5)
- {
- input.style.color = "000000";
- }
- else
- {
- input.style.color = "FFFFFF";
- }
- return;
- }
- </script>
- </head>
- <body>
- <form action="/post" method="postp" enctype="application/x-www-form-urlencoded" style="font-family:courier;">
- __
- <input type="text" size="12" value="R G B" style="font-family:courier;" readonly>
- <br>
- 00
- <input type="text" size="12" value="FF00FF" onchange="colorCh(this)" style="background-color:#FF00FF;font-family:courier;">
- <br>
- <input type="submit" value="Submit">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment