Java Color Brighten getGradientBrightColors(Color baseColor, float step, float max)

Here you can find the source of getGradientBrightColors(Color baseColor, float step, float max)

Description

get Gradient Bright Colors

License

Open Source License

Declaration

public static Color[] getGradientBrightColors(Color baseColor, float step, float max) 

Method Source Code


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

import java.awt.Color;

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static Color[] getGradientBrightColors(Color baseColor, float step, float max) {
        List<Color> list = new ArrayList<Color>();
        float color[] = Color.RGBtoHSB(baseColor.getRed(), baseColor.getGreen(), baseColor.getBlue(), null);

        list.add(baseColor);/* ww w.ja  v  a 2s.  c  o m*/

        for (; (color[2] += step) < (max);) {
            list.add(Color.getHSBColor(color[0], color[1], color[2]));
        }

        return list.toArray(new Color[] {});
    }
}

Related

  1. getBrightness(Color color)
  2. getBrightness(Color color)
  3. getBrightness(Color color)
  4. getBrightness(int red, int green, int blue)
  5. getBrightness(java.awt.Color color)
  6. getRandomBrightColor()
  7. getSlightlyBrighter(Color color)
  8. getSlightlyBrighter(Color color)
  9. hsbToRgB(double hue, double sat, double brightness)