Java Color Brighten whiter(Color color)

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

Description

This returns a whiter color than c.

License

Open Source License

Parameter

Parameter Description
color a parameter

Return

a whiter color than c

Declaration

public static Color whiter(Color color) 

Method Source Code

//package com.java2s;
/* /*from w w w  .ja  v a 2s. c o m*/
 * SgtUtil Copyright 2005, NOAA.
 * See the LICENSE.txt file in this file's directory.
 */

import java.awt.Color;

public class Main {
    /**
     * This returns a whiter color than c.
     *
     * @param color
     * @return a whiter color than c
     */
    public static Color whiter(Color color) {
        int r = color.getRed();
        int g = color.getGreen();
        int b = color.getBlue();
        return new Color(r + (255 - r) / 4, //little changes close to 255 have big effect
                g + (255 - g) / 4, b + (255 - b) / 4);
    }
}

Related

  1. setBrightness(Color color, float brightness)
  2. setBrightness(Color color, float brightness)
  3. setColorBrightness(Color c, double y)
  4. shiftHSB(java.awt.Color color, double hueDelta, double saturationDelta, double brightnessDelta)
  5. slightlyBrighter(Color color)