Java Color Brighten getRandomBrightColor()

Here you can find the source of getRandomBrightColor()

Description

get Random Bright Color

License

Open Source License

Declaration

public static Color getRandomBrightColor() 

Method Source Code

//package com.java2s;
/**/*from   w  ww  . j av  a 2  s  .com*/
 * Copyright? 2014-2016 LIST (Luxembourg Institute of Science and Technology), all right reserved.
 * Authorship : Olivier PARISOT, Yoanne DIDRY
 * Licensed under GNU General Public License version 3
 */

import java.awt.Color;

import java.util.Random;

public class Main {
    public static Color getRandomBrightColor() {
        final Color mix = Color.WHITE;
        final Random random = new Random();
        int red = random.nextInt(256);
        int green = random.nextInt(256);
        int blue = random.nextInt(256);

        // mix the color
        if (mix != null) {
            red = (red + mix.getRed()) / 2;
            green = (green + mix.getGreen()) / 2;
            blue = (blue + mix.getBlue()) / 2;
        }

        return new Color(red, green, blue);
    }
}

Related

  1. getBrightness(Color color)
  2. getBrightness(Color color)
  3. getBrightness(int red, int green, int blue)
  4. getBrightness(java.awt.Color color)
  5. getGradientBrightColors(Color baseColor, float step, float max)
  6. getSlightlyBrighter(Color color)
  7. getSlightlyBrighter(Color color)
  8. hsbToRgB(double hue, double sat, double brightness)
  9. HSBtoRGB(float hue, float saturation, float brightness)