Java Random Color getRandColor(int fc, int bc)

Here you can find the source of getRandColor(int fc, int bc)

Description

get Rand Color

License

Open Source License

Declaration

private static Color getRandColor(int fc, int bc) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.*;

import java.util.Random;

public class Main {

    private static Color getRandColor(int fc, int bc) {
        int f = fc;
        int b = bc;
        Random random = new Random();
        if (f > 255) {
            f = 255;//from   w  w w.  j  a  va  2s  .  com
        }
        if (b > 255) {
            b = 255;
        }
        return new Color(f + random.nextInt(b - f), f + random.nextInt(b - f), f + random.nextInt(b - f));
    }
}

Related

  1. getRandColor(int fc, int bc)
  2. getRandColor(int fc, int bc)
  3. getRandom()
  4. getRandomColor()