Convert RGB to HSB : Color Model « 2D Graphics GUI « Java

Convert RGB to HSB


import java.awt.Color;

public class Main {
  public static void main() {
    int red = 23;
    int green = 66;
    int blue = 99;

    float[] hsb = Color.RGBtoHSB(red, green, blue, null);
    float hue = hsb[0]; 
    float saturation = hsb[1];
    float brightness = hsb[2];



Related examples in the same category

1.Convert HSB to RGB value
3.Color model demoColor model demo
4.Color CompositeColor Composite
5.Image Color Effect: Brightness, Contrast, NegativeImage Color Effect: Brightness, Contrast, Negative
6.Image Color Gray EffectImage Color Gray Effect
7.Checking for Color ModelsChecking for Color Models
8.Layers - Try to use alpha values (transparency) to draw in layersLayers - Try to use alpha values (transparency) to draw in layers
9.RGB Gray Filter
10.Color Schema Generator