avoid too bright colors
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Debucquoy Anthony 2023-05-18 19:46:19 +02:00
parent fed275ba09
commit 774c594cb8
Signed by: tonitch
GPG Key ID: A78D6421F083D42E

View File

@ -21,7 +21,8 @@ public class Piece extends Shape{
public Piece(boolean[][] matrix) {
super(matrix);
Random rand = new Random();
color = new Color(rand.nextDouble(), rand.nextDouble(), rand.nextDouble(), 1);
// the %.8 is there to avoid pieces that are too "white" so that we can see them
color = new Color(rand.nextDouble()%.8, rand.nextDouble() %.8, rand.nextDouble()%.8, 1);
}
public void setColor(Paint p){