Java examples for 2D Graphics:Color RGB
Convert RGB To HSB Color
import java.applet.Applet; import java.awt.Color; import java.awt.Graphics; public class Main { public void paint(Graphics g){ float[] hsbValues = new float[3]; /*from w ww . ja va 2s . co m*/ hsbValues = Color.RGBtoHSB(255,10,10,hsbValues); float hue, saturation, brightness; hue = hsbValues[0]; saturation = hsbValues[1]; brightness = hsbValues[2]; g.drawString("Hue: " + hue + ", Saturation:" + saturation + ", Brightness:" + brightness,10,50); } }