Answers for "java awt color get random"

4

creating random color in java

Random rand = new Random();
    // Java 'Color' class takes 3 floats, from 0 to 1.
    float r = rand.nextFloat();
    float g = rand.nextFloat();
    float b = rand.nextFloat();
    Color randomColor = new Color(r, g, b);
Posted by: Guest on December-04-2019

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language