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 16:37] – 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 32: | Line 32: | ||
} | } | ||
- | echo '< | + | $i=0; |
+ | $x=0; | ||
+ | |||
+ | echo '< | ||
foreach ($colors as $color) { | foreach ($colors as $color) { | ||
Line 42: | Line 45: | ||
$x_hex | $x_hex | ||
$y_hex | $y_hex | ||
+ | |||
+ | if ($i>1 && ($i%6) == 0) { | ||
+ | if ($x==6) { $x=0; } | ||
+ | echo '< | ||
+ | $x++; | ||
+ | } | ||
if (($i%6) == 0) { | if (($i%6) == 0) { | ||
- | echo '</ | + | echo '</ |
if ($x_tmp !== $x_hex) { | if ($x_tmp !== $x_hex) { | ||
echo '< | echo '< | ||
Line 56: | Line 65: | ||
} | } | ||
- | echo '</ | + | echo '< |
</ | </ | ||
{{tag> | {{tag> | ||
~~NOCACHE~~ | ~~NOCACHE~~ |