Java Color Create generateColor(int fc, int bc)

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

Description

generate Color

License

Apache License

Declaration

private static Color generateColor(int fc, int bc) 

Method Source Code

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

import java.awt.*;

import java.util.Random;

public class Main {

    private static Color generateColor(int fc, int bc) {
        Random random = new Random();
        if (fc > 255)
            fc = 255;//  w  w  w . java 2s  .  c o m
        if (bc > 255)
            bc = 255;
        int r = fc + random.nextInt(bc - fc);
        int g = fc + random.nextInt(bc - fc);
        int b = fc + random.nextInt(bc - fc);
        return new Color(r, g, b);
    }
}

Related

  1. colorFromRGBA(int red, int green, int blue, int alpha)
  2. colorFromString(String string)
  3. colorWithARGB(int alpha, int red, int green, int blue)
  4. colorWithIntAndAlpha(int color, int alpha)
  5. generateBlankImage(int w, int h, Color col)
  6. generateColorFromString(String seed)
  7. generateColorModel()
  8. generateColorRamp(int n)
  9. generateColourSet(Color[] palette, int numColorBands)