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
+1 -15
View File
@@ -34,23 +34,9 @@ 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;
}
$fondRGB=[0,0,0];
$fond=imagecolorallocate($vImage,$fondRGB[0],$fondRGB[1],$fondRGB[2]);
$couleurRGB=[240,147,43];
$couleur=imagecolorallocate($vImage,$couleurRGB[0],$couleurRGB[1],$couleurRGB[2]);
// Remplir le fond
imagefilledrectangle($vImage, $x+($marge_x/2), $y+($marge_y/2), $x+$width-+($marge_x/2), $y+$height-+($marge_y/2), $fond);
@@ -168,7 +154,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);