Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title> kolory RGB i hex </title>
- <style>
- #ramka{
- width:463px;
- height:100px;
- background-color:black;
- }
- </style>
- <script>
- function kolory()
- {
- let x,y,z;
- x=document.getElementById('r').value;
- y=document.getElementById('g').value;
- z=document.getElementById('b').value;
- x=parseInt(x);
- y=parseInt(y);
- z=parseInt(z);
- document.getElementById('ramka').style.backgroundColor='rgb('+x+', '+y+', '+z+')';
- }
- </script>
- </head>
- <body>
- <div id="ramka"> </div>
- rgb(
- <input type="number" id="r" min=0 max=255 value="0" onchange="kolory()">,
- <input type="number" id="g" min=0 max=255 value="0" onchange="kolory()">,
- <input type="number" id="b" min=0 max=255 value="0" onchange="kolory()">
- )
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement