public class RandomColorGen {
public static Color RandColor() {
Random rand = new Random();
float r = rand.nextFloat();
float g = rand.nextFloat();
float b = rand.nextFloat();
Color c = new Color(r, g, b, 1);
return c;
}
public static ArrayList ColorList(int numOfColors) {
ArrayList colorList = new ArrayList();
for (int i = 0; i < numOfColors; i++) {
Color c = RandColor();
if(similarcolors){
dont add
}
colorList.add(c);
}
return colorList;
}
}
< /code>
Я действительно запутался, пожалуйста, помогите
Подробнее здесь: https://stackoverflow.com/questions/152 ... rs-in-java