Java Random Color randomColor()

Here you can find the source of randomColor()

Description

random Color

License

Apache License

Declaration

public static Color randomColor() 

Method Source Code


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

import java.awt.Color;

public class Main {
    public static Color randomColor() {
        int c = (int) (Math.random() * 255);
        return new Color(Math.abs(c * 25) % 255, Math.abs(17 * c) % 255, Math.abs(34 * c) % 255);
    }/*from  ww  w .j  av a2  s  . c  o  m*/
}

Related

  1. makeRandomColor()
  2. makeRandomColor()
  3. makeRandomColor(Color color)
  4. makeRandomColor(Color color, Color darkestColor, int maxAttempts)
  5. randomBrown()
  6. randomColor()
  7. randomColor()
  8. randomColor()
  9. randomColor()