Java Utililty Methods Random Color

List of utility methods to do Random Color

Description

The list of methods to do Random Color are organized into topic(s).

Method

ColorgetRandColor(int fc, int bc)
get Rand Color
int f = fc;
int b = bc;
Random random = new Random();
if (f > 255) {
    f = 255;
if (b > 255) {
    b = 255;
...
ColorgetRandColor(int fc, int bc)
get Rand Color
int _fc = 255;
if (fc < 255) {
    _fc = fc;
int _bc = 255;
if (bc < 255) {
    _bc = bc;
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);
ColorgetRandColor(int fc, int bc)
get Rand Color
Random random = new Random();
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);
ColorgetRandom()
get Random
int r = randomInt(256), 
        g = randomInt(256), 
        b = randomInt(256);
return new Color(r, g, b);
StringgetRandomColor()
get Random Color
Integer red = rand.nextInt(255);
Integer blie = rand.nextInt(255);
Integer yellow = rand.nextInt(255);
String color = "#" + red.toHexString(red) + blie.toHexString(blie) + yellow.toHexString(yellow);
return color;
ColorgetRandomColor()
get Random Color
return new Color(RND.nextInt());
ColorgetRandomColor()
get Random Color
Random rand = new Random();
float r = rand.nextFloat();
float g = rand.nextFloat();
float b = rand.nextFloat();
Color randomColor = new Color(r, g, b);
return randomColor;
StringGetRandomColor()
Get Random Color
Random rand = new Random();
Integer random = rand.nextInt(17);
return dictionary.get(random);
StringgetRandomColor()
get Random Color
Random ra = new Random();
int r, g, b;
r = ra.nextInt(255);
g = ra.nextInt(255);
b = ra.nextInt(255);
String hex = String.format("#%02x%02x%02x", r, g, b);
return hex;
bytegetRandomColor()
get Random Color
int color = 1 + RANDOM.nextInt(11);
color = color > 6 ? color + 2 : color;
color = color > 11 ? color + 1 : color;
return (byte) color;