Java Color Lighten lighter(Color clr)

Here you can find the source of lighter(Color clr)

Description

lighter

License

Open Source License

Declaration

public static Color lighter(Color clr) 

Method Source Code


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

import java.awt.Color;

public class Main {
    public static Color lighter(Color clr) {
        float[] hsb = new float[3];
        Color.RGBtoHSB(clr.getRed(), clr.getGreen(), clr.getBlue(), hsb);
        hsb[1] *= 0.4;/*from  www .  j a va2 s .c  om*/
        return Color.getHSBColor(hsb[0], hsb[1], hsb[2]);
    }

    public static Color lighter(Color clr, double saturationFraction) {
        float[] hsb = new float[3];
        Color.RGBtoHSB(clr.getRed(), clr.getGreen(), clr.getBlue(), hsb);
        hsb[1] *= saturationFraction;
        return Color.getHSBColor(hsb[0], hsb[1], hsb[2]);
    }
}

Related

  1. lightenColor(Color color)
  2. lighter(Color c)
  3. lighter(Color c)
  4. lighter(Color c, boolean transparant)
  5. lighter(Color c, float factor)
  6. lighter(Color clr, double saturationFraction)
  7. lighter(Color color, double fraction)
  8. lighter(Color color, float ratio)
  9. lighter(final Color color, final int rgbOffset)