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