Java Color Lighten lighter(Color c, boolean transparant)

Here you can find the source of lighter(Color c, boolean transparant)

Description

lighter

License

Open Source License

Declaration

public static Color lighter(Color c, boolean transparant) 

Method Source Code


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

import java.awt.Color;

public class Main {
    public static Color lighter(Color c, boolean transparant) {
        double org = 0.6;
        double white = 0.4;
        if (!transparant)
            return new Color((int) (c.getRed() * org + 0xff * white), (int) (c.getGreen() * org + 0xff * white),
                    (int) (c.getBlue() * org + 0xff * white));
        else//  ww w  .j a v a 2  s  .  c o  m
            return new Color((int) (c.getRed() * org + 0xff * white), (int) (c.getGreen() * org + 0xff * white),
                    (int) (c.getBlue() * org + 0xff * white), (int) (0.8 * 0xff));
    }
}

Related

  1. lighten(int r, int g, int b, double percent)
  2. lightenColor(Color col, float factor)
  3. lightenColor(Color color)
  4. lighter(Color c)
  5. lighter(Color c)
  6. lighter(Color c, float factor)
  7. lighter(Color clr)
  8. lighter(Color clr, double saturationFraction)
  9. lighter(Color color, double fraction)