Here you can find the source of lighter(Color clr, double saturationFraction)
public static Color lighter(Color clr, double saturationFraction)
//package com.java2s; /*/*from w ww. ja v a 2 s . c o m*/ * Copyright (c) 2016 Vivid Solutions. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Eclipse Distribution License v. 1.0 which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * * http://www.eclipse.org/org/documents/edl-v10.php. */ import java.awt.Color; public class Main { public static Color lighter(Color clr) { return lighter(clr, 0.4); } 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]); } }