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;
//  Licensed under the Apache License, Version 2.0 (the "License");

import java.awt.*;

public class Main {
    public static Color randomColor() {
        return new Color(randomColorValue(), randomColorValue(), randomColorValue());
    }//from  w  w w  .j  ava  2s . c  o  m

    private static int randomColorValue() {
        return (int) (Math.random() * 255);
    }
}

Related

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