Here you can find the source of adjustColorBrightness(Color base, float brightness)
public static Color adjustColorBrightness(Color base, float brightness)
//package com.java2s; //License from project: Open Source License import java.awt.Color; public class Main { public static Color adjustColorBrightness(Color base, float brightness) { float hsb[] = Color.RGBtoHSB(base.getRed(), base.getGreen(), base.getBlue(), null); hsb[2] += brightness;//from w w w . j av a 2 s .co m hsb[2] = hsb[2] < 0.0f ? 0.0f : (hsb[2] > 1.0f ? 1.0f : hsb[2]); return Color.getHSBColor(hsb[0], hsb[1], hsb[2]); } }