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
+3 -16
View File
@@ -28,21 +28,8 @@ function DrawBlock($the_block, $vImage, $parametres)
if (isset($parametres['font_RGB'])) $vFgRGB = $parametres['font_RGB'];
if (isset($parametres['background_RGB'])) $vBgRGB = $parametres['background_RGB'];
// 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);
// Récup des données
$data = blockchain::getTransactionData($the_block, $type);
@@ -66,7 +53,7 @@ function DrawBlock($the_block, $vImage, $parametres)
if ($nb < 5) $alpha = 0;
// Dégradé de 360 couleurs entre la couleur de dessin et le blanc
$vColor = getGDcolorGradientArray($vImage, 360, $couleurRGB, $fondRGB, $alpha);
$vColor = getGDcolorGradientArray($vImage, 360, $vBgRGB, $vFgRGB, $alpha);
// Le rayon du cercle dépend du montant de la transaction
//$r0 = $width / 3;
@@ -97,7 +84,7 @@ function DrawBlock($the_block, $vImage, $parametres)
// Un coef aléatoire
$coef = 0.1;
$c = rand(0,10);
$c = $transaction['value']%10;
if ($c > 5) $coef = 0.3;
if ($c > 7) $coef = 0.8;
if ($c > 9) $coef = 1.2;