enlever le hasard
This commit is contained in:
@@ -33,30 +33,17 @@ function DrawBlock($the_block, $vImage, $parametres)
|
||||
if (isset($parametres['iterations'])) $local_iterations = $parametres['iterations'];
|
||||
|
||||
$facteur_max = 2.5 * ($height / GRAPH_HEIGHT);
|
||||
|
||||
// Une chance sur deux d'inverser entre fg et bg
|
||||
if (rand(0,100) < 50) {
|
||||
$fond = $vBgColor;
|
||||
$couleur = $vFgColor;
|
||||
$fondRGB = $vBgRGB;
|
||||
$couleurRGB = $vFgRGB;
|
||||
} else {
|
||||
$fond = $vFgColor;
|
||||
$couleur = $vBgColor;
|
||||
$fondRGB = $vFgRGB;
|
||||
$couleurRGB = $vBgRGB;
|
||||
}
|
||||
|
||||
|
||||
// Remplir le fond
|
||||
imagefilledrectangle($vImage, $x+($marge_x/2), $y+($marge_y/2), $x+$width-+($marge_x/2), $y+$height-+($marge_y/2), $fond);
|
||||
imagefilledrectangle($vImage, $x+($marge_x/2), $y+($marge_y/2), $x+$width-+($marge_x/2), $y+$height-+($marge_y/2), $vFgColor);
|
||||
|
||||
// Dégradé de 256 couleurs entre la couleur de fond et la couleur de dessin
|
||||
$alpha = 100;
|
||||
$nb_colors = 256;
|
||||
$vColor = array();
|
||||
$hex_val = array(
|
||||
ColorGradient::rgb2hex($couleurRGB),
|
||||
ColorGradient::rgb2hex($fondRGB)
|
||||
ColorGradient::rgb2hex($vBgRGB),
|
||||
ColorGradient::rgb2hex($vFgRGB)
|
||||
);
|
||||
$gradient = ColorGradient::gradient($hex_val[0], $hex_val[1], $nb_colors);
|
||||
for($i=0;$i<$nb_colors;$i++)
|
||||
@@ -148,7 +135,7 @@ function DrawBlock($the_block, $vImage, $parametres)
|
||||
if ($valeur != 0)
|
||||
{
|
||||
$decal = 15.0 * ($i / TX_HASH_LEN);
|
||||
$valeur += rand(0, floor($decal));
|
||||
$valeur += floor($decal);
|
||||
$valeur /= 2;
|
||||
$valeur -= 8;
|
||||
$y0 = $h0 + ($valeur * $facteur);
|
||||
|
||||
Reference in New Issue
Block a user