-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdechex.php
More file actions
43 lines (36 loc) · 1.13 KB
/
Copy pathdechex.php
File metadata and controls
43 lines (36 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
$decimal=255;
$hex="00".dechex($decimal)."00";
echo "<table border=\"1\" width=\100px\">";
for ($n1=0;$n1<16;$n1++){
echo "<tr>";
for ($n2=0;$n2<3;$n2++){
if ($n2=0){
$decimal=255;
$hex="00".dechex($decimal)."00";
echo "<td style='background-color: #$hex'>$n1</td>";
echo $hex;
$decimal=$decimal-17;
$hex="00".dechex($decimal)."00";
}
if ($n2=1){
$decimal=255;
$hex=dechex($decimal)."00"."00";
echo "<td style='background-color: #$hex'>$n1</td>";
echo $hex;
$decimal=$decimal-17;
$hex=dechex($decimal)."00"."00";
}
if ($n2=2){
$decimal=255;
$hex="00"."00".dechex($decimal);
echo "<td style='background-color: #$hex'>$n1</td>";
echo $hex;
$decimal=$decimal-17;
$hex="00"."00".dechex($decimal);
}
}
echo "</tr>";
}
echo "</table>";
?>