Java Random Color randomColor()

Here you can find the source of randomColor()

Description

random Color

License

LGPL

Declaration

public static Color randomColor() 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.awt.*;
import java.util.*;

public class Main {
    static Random r = new Random();

    public static Color randomColor() {
        return new Color(r.nextInt(255), r.nextInt(255), r.nextInt(255));
    }/*  www.ja va 2  s  .co m*/

    public static Color randomColor(int alpha) {
        return new Color(r.nextInt(255), r.nextInt(255), r.nextInt(255), alpha);
    }
}

Related

  1. randomColor()
  2. randomColor()
  3. randomColor()
  4. randomColor()
  5. randomColor()
  6. randomColor(int idx)
  7. randomColor(int seed)
  8. randomColor(Random r)
  9. randomColorFactor()