Java Color Brighten getSlightlyBrighter(Color color)

Here you can find the source of getSlightlyBrighter(Color color)

Description

get Slightly Brighter

License

Open Source License

Declaration

public static Color getSlightlyBrighter(Color color)
    

Method Source Code

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

import java.awt.Color;

public class Main {
    public static Color getSlightlyBrighter(Color color)
    /* 114:    */{
        /* 115:389 */return getSlightlyBrighter(color, 1.1F);
        /* 116:    */}

    public static Color getSlightlyBrighter(Color color, float factor)
    /* 119:    */{
        /* 120:401 */float[] hsbValues = new float[3];
        /* 121:402 */Color.RGBtoHSB(color.getRed(), color.getGreen(),
                color.getBlue(), hsbValues);
        /* 122:    */
        /* 123:    */
        /* 124:    */
        /* 125:    */
        /* 126:407 */float hue = hsbValues[0];
        /* 127:408 */float saturation = hsbValues[1];
        /* 128:409 */float brightness = hsbValues[2];
        /* 129:410 */float newBrightness = Math.min(brightness * factor,
                1.0F);//from ww  w  .  j  a  v  a  2 s  .  c o m
        /* 130:411 */return Color.getHSBColor(hue, saturation,
                newBrightness);
        /* 131:    */}
}

Related

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