Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table>
- <?PHP
- $col=0;
- for($r=0;$r<=255;$r++)
- {
- $red=dechex($r);
- if($r<16)
- {
- $red='0'.$red;
- }
- for($g=0;$g<=255;$g++)
- {
- $green=dechex($g);
- if($g<16)
- {
- $green='0'.$green;
- }
- for($b=0;$b<=255;$b++)
- {
- $blue=dechex($b);
- if($b<16)
- {
- $blue='0'.$blue;
- }
- if($col==0)
- {
- echo '<tr>';
- }
- echo '<td><input type="button" onclick="document.body.style.backgroundColor = '."'#".$red.$green.$blue."'".'" value="#'.$red.$green.$blue.'"></td>';
- if($col==20)
- {
- echo '<tr>';
- }
- $col++;
- if($col>20)
- {
- $col=0;
- }
- }
- }
- }
- ?>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement