enlever le hasard

This commit is contained in:
2022-08-21 09:30:06 +02:00
parent 6d161b3804
commit 0bf16e3ab5
17 changed files with 161 additions and 174 deletions
+4 -17
View File
@@ -34,29 +34,16 @@ function DrawBlock($the_block, $vImage, $parametres)
$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);