Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
programming:web_safe_colors [2014/07/09 14:33] – Giuseppe Di Terlizzi | programming:web_safe_colors [2015/01/20 14:02] (current) – Giuseppe Di Terlizzi | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Web Safe Colors ====== | ====== Web Safe Colors ====== | ||
- | Questa pagina elenca i 216 colori " | + | {{https:// |
Per ricavare velocemente l' | Per ricavare velocemente l' | ||
Line 9: | Line 9: | ||
$colors = array(); | $colors = array(); | ||
- | foreach ($hex as $c1) { | + | foreach ($hex as $col1) { |
- | foreach ($hex as $c2) { | + | foreach ($hex as $col2) { |
- | foreach ($hex as $c3) { | + | foreach ($hex as $col3) { |
- | $colors[] = "$c1$c2$c3"; | + | $colors[] = "$col1$col2$col3"; |
} | } | ||
} | } | ||
Line 18: | Line 18: | ||
</ | </ | ||
- | ===== Tabelle | + | ===== Tabella |
<php> | <php> | ||
Line 27: | Line 27: | ||
foreach ($hex as $c2) { | foreach ($hex as $c2) { | ||
foreach ($hex as $c3) { | foreach ($hex as $c3) { | ||
- | $colors[] = " | + | $colors[] = array(' |
} | } | ||
} | } | ||
} | } | ||
- | echo '<div class=" | + | $i=0; |
+ | $x=0; | ||
+ | |||
+ | echo '<table style=" | ||
foreach ($colors as $color) { | foreach ($colors as $color) { | ||
- | $x++; | ||
- | if ($x <= 72) { | ||
- | echo "< | ||
- | } | ||
- | } | ||
- | echo '</ | + | $c_hex |
+ | $c_dec | ||
+ | $b_color = ((int)(hexdec(substr($color[' | ||
+ | $test = hexdec(substr($color[' | ||
+ | $x_hex | ||
+ | $y_hex | ||
- | echo '<div class=" | + | if ($i>1 && ($i%6) == 0) { |
+ | if ($x==6) { $x=0; } | ||
+ | | ||
+ | $x++; | ||
+ | } | ||
- | foreach | + | if (($i%6) == 0) { |
- | $y++; | + | echo '</ |
- | if ($y > 72 && | + | if ($x_tmp !== $x_hex) { |
- | echo "< | + | echo '<td style=" |
+ | } | ||
} | } | ||
- | } | ||
- | echo '</tbody></table></div>'; | + | |
- | echo '< | + | $i++; |
+ | $x_tmp | ||
- | foreach ($colors as $color) { | ||
- | $z++; | ||
- | if ($z >144) { | ||
- | echo "< | ||
- | } | ||
} | } | ||
- | + | echo '<td>FF</td></tr></table>'; | |
- | echo '</tbody></table></div>'; | + | |
- | + | ||
- | echo '< | + | |
</ | </ | ||
{{tag> | {{tag> | ||
~~NOCACHE~~ | ~~NOCACHE~~ |