Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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);
 
PREVIOUS NEXT
Tagged: #creating #random #color #java
ADD COMMENT
Topic
Name
8+1 =