comp:en:farbtafel
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | comp:en:farbtafel [2008-08-24 0343] (current) – created werner | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Safe Colours in the Web ===== | ||
+ | ==== The colour scheme ==== | ||
+ | |||
+ | <php> | ||
+ | echo '</ | ||
+ | for ($R = 0x0; $R <= 0xf; $R += 0x3) { | ||
+ | $ROT = sprintf(" | ||
+ | $tf = ($R == 0xf) ? "# | ||
+ | for ($G = 0x0; $G <= 0xf; $G += 0x3) { | ||
+ | echo "< | ||
+ | $GRUEN = sprintf(" | ||
+ | if ($G >= 0xc) { | ||
+ | $tf = "# | ||
+ | } | ||
+ | for ($B = 0x0; $B <= 0xf; $B +=0x3) { | ||
+ | $BLAU = sprintf(" | ||
+ | echo ' | ||
+ | echo "# $ROT $GRUEN $BLAU</ | ||
+ | } // for $B | ||
+ | echo " | ||
+ | } // for $G | ||
+ | } // for $R | ||
+ | echo "</ | ||
+ | </ | ||
+ | |||
+ | Colour numbers are given in XHTML style; for HTML style, you may " | ||
+ | |||
+ | ==== and the source code: ==== | ||
+ | <code php> | ||
+ | echo '< | ||
+ | for ($R = 0x0; $R <= 0xf; $R += 0x3) { | ||
+ | $ROT = sprintf(" | ||
+ | $tf = ($R == 0xf) ? "# | ||
+ | for ($G = 0x0; $G <= 0xf; $G += 0x3) { | ||
+ | echo "< | ||
+ | $GRUEN = sprintf(" | ||
+ | if ($G >= 0xc) { $tf = "# | ||
+ | for ($B = 0x0; $B <= 0xf; $B +=0x3) { | ||
+ | $BLAU = sprintf(" | ||
+ | echo ' | ||
+ | '; | ||
+ | echo "# $ROT $GRUEN $BLAU</ | ||
+ | } // for $B | ||
+ | echo " | ||
+ | } // for $G | ||
+ | } // for $R | ||
+ | echo "</ | ||
+ | </ | ||
+ | |||
+ | Of course the " | ||
+ | <code php> | ||
+ | echo ' | ||
+ | $ROT, $GRUEN, $BLAU, '; color:', | ||
+ | ';" | ||
+ | </ | ||
+ | |||
+ | If you want to change the output so that HTML values are displayed, you have to make following modifications: | ||
+ | * the condition for the loop reads '' | ||
+ | * the loop counter is incremented with '' | ||
+ | * the output changes to '' |
comp/en/farbtafel.txt · Last modified: 2008-08-24 0343 by werner