An other method to avoid all type of white
Antho free to change this one I'm a little to lazy at this time
This commit is contained in:
parent
fbd214bc23
commit
ecdff3cbd0
@ -6,6 +6,7 @@ import javafx.scene.paint.Paint;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import static javafx.scene.paint.Color.WHITE;
|
||||||
import static javafx.scene.paint.Color.color;
|
import static javafx.scene.paint.Color.color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,12 +24,9 @@ public class Piece extends Shape{
|
|||||||
public Piece(boolean[][] matrix) {
|
public Piece(boolean[][] matrix) {
|
||||||
super(matrix);
|
super(matrix);
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
color = new Color(rand.nextDouble(), rand.nextDouble(), rand.nextDouble(), 1);
|
color = new Color((rand.nextDouble()%190), (rand.nextDouble()%190), (rand.nextDouble()%190), 1);
|
||||||
while(color.equals(Color.WHITE)) {
|
|
||||||
color = new Color(rand.nextDouble(), rand.nextDouble(), rand.nextDouble(), 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
public void setColor(Paint p){
|
public void setColor(Paint p){
|
||||||
color = p;
|
color = p;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user