Java Color Brighten brighter(Color c)

Here you can find the source of brighter(Color c)

Description

This is a weaker version of Color#brighter() Uses a factor closer to 1.

License

Open Source License

Return

brighter Color

Declaration

public static Color brighter(Color c) 

Method Source Code


//package com.java2s;
import java.awt.Color;

public class Main {
    /**/*from  w ww  .  ja v  a2  s .c  o m*/
     * This is a weaker version of {@link Color#brighter()}
     * Uses a factor closer to 1.
     * @see Color#brighter()
     * @return brighter Color
     */
    public static Color brighter(Color c) {
        float[] hsb = new float[3];
        int r = c.getRed();
        int g = c.getGreen();
        int b = c.getBlue();
        Color.RGBtoHSB(r, g, b, hsb);
        //System.out.println("Saturation: " + hsb[1] + "   ->   " + (hsb[1] * 1.05f));
        //System.out.println("Brightness: " + hsb[2] + "   ->   " + (hsb[2] * 1.05f));
        return Color.getHSBColor(hsb[0], Math.min(1f, hsb[1] * 1.3f), Math.min(1f, hsb[2] * 1.05f));
    }
}

Related

  1. brighten(final int color)
  2. brighten(final int cValue, double colorBrigthnessFactor)
  3. brighten(float[] rgb, float luminosity)
  4. brightenColor(Color color, double factor)
  5. brighter(Color c)
  6. brighter(Color c, double factor)
  7. brighter(Color c, double p)
  8. brighter(Color col, double FACTOR)
  9. brighter(Color color)