📜  在 java 代码示例中创建随机颜色

📅  最后修改于: 2022-03-11 14:52:49.005000             🧑  作者: Mango

代码示例1
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);