All pastes #1943869 Raw Edit

Miscellany

public html v1 · immutable
#1943869 ·published 2010-09-19 01:05 UTC
rendered paste body
<html>    <head>        <title>Test colors</title>        <script type="text/javascript">            function color(orig){                return (orig+127)%256;            }            function generateColor(){                r = Math.ceil(Math.random()*255);                g = Math.ceil(Math.random()*255);                b = Math.ceil(Math.random()*255);                document.getElementById('original').style.backgroundColor = "rgb("+r+", "+g+", "+b+")";                document.getElementById('original').style.color = "rgb("+color(r)+", "+color(g)+", "+color(b)+")";                document.getElementById('bg').innerHTML = "#"+(r).toString(16)+""+(g).toString(16)+""+(b).toString(16);                document.getElementById('texte').innerHTML = "#"+color(r).toString(16)+""+color(g).toString(16)+""+color(b).toString(16);            }        </script>        <style type="text/css">            div {                display: block;                width: 200px;                height: 50px;            }        </style>    </head>    <body>        <a href="javascript:void(0);" onclick="javascript:generateColor();">Generer couleur</a>        <div id="original"><strong>Un texte</strong></div>        Fond = <span id="bg"></span><br />        Font = <span id="texte"></span>    </body></html>