Pour éditer le wiki, il faut demander un compte à un Lapin !
GenerationDePaletteDeCouleurs
From Le L∞p's Wiki
Revision as of 21:31, 12 December 2012 by ToM (Talk | contribs) (ToM moved page Pastebin to GenerationDePaletteDeCouleurs)
generation de palette de couleur
un petit script naif pour generer une palette de 24 couleurs, potentiellement adequate pour du graphing
Usage: ./palette.pl | sed 's/100/ff/g' > ./palette.html
Patches welcome
#!/usr/bin/perl print "<html> <head><title>palette</title></head> <body>\n"; for $v1 ( 4,3 ) { $v = $v1 / 4; for $s1 ( 2 ) { $s = $s1/2; for $h1 (0,1,2,3,4,5,6,7,8,9,10,11) { $h = $h1 * 30; $ti = int($h/60) % 6; $f = $h/60 - $ti; $l = $v * (1 - $s); $m = $v * (1 - $f * $s); $n = $v * (1 - (1 - $f) * $s); @r = ($v,$m,$l,$l,$n,$v); @g = ($n,$v,$v,$m,$l,$l); @b = ($l,$l,$n,$v,$v,$m); printf("<span style=\"background-color : #%.2x%.2x%.2x\"> </span>\n",$r[$ti]*256,$g[$ti]*256,$b[$ti]*256); } } } print "</body></html>\n";