Get HSB Color from RGB - Java 2D Graphics

Java examples for 2D Graphics:Color RGB

Description

Get HSB Color from RGB

Demo Code


//package com.java2s;
import java.awt.Color;

public class Main {
    public static void main(String[] argv) throws Exception {
        float parHue = 2.45678f;
        float parSaturation = 2.45678f;
        float parBrightness = 2.45678f;
        System.out.println(HSBtoRGB(parHue, parSaturation, parBrightness));
    }/*from  w  w  w. ja  v a 2s .co  m*/

    /**Get HSB from RGB*/
    public static int HSBtoRGB(float parHue, float parSaturation,
            float parBrightness) {
        return Color.HSBtoRGB(parHue, parSaturation, parBrightness);
    }
}

Related Tutorials