Java Color.RGBtoHSB(int r, int g, int b, float[] hsbvals)

Syntax

Color.RGBtoHSB(int r, int g, int b, float[] hsbvals) has the following syntax.

public static float[] RGBtoHSB(int r,  int g,  int b,  float[] hsbvals)

Example

In the following code shows how to use Color.RGBtoHSB(int r, int g, int b, float[] hsbvals) method.


import java.awt.Color;
import java.util.Arrays;
//  w w  w.j  a v  a  2  s  .co  m
public class Main {
  public static void main() {
    int red = 23;
    int green = 66;
    int blue = 99;

    float[] hsb = Color.RGBtoHSB(red, green, blue, null);
    System.out.println(Arrays.toString(hsb));

  }
}




















Home »
  Java Tutorial »
    java.awt »




BasicStroke
BorderLayout
CardLayout
Color
Cursor
Desktop
DesktopManager
DisplayMode
EventQueue
FlowLayout
FocusTraversalPolicy
Font
FontMetrics
GradientPaint
Graphics
Graphics2D
GraphicsConfiguration
GraphicsDevice
GraphicsEnvironment
GridBagConstraints
GridBagLayout
GridLayout
Image
ItemSelectable
KeyboardFocusManager
LayoutManager
LayoutManager2
Point
Rectangle
Robot
Shape
SplashScreen
SystemColor
SystemTray
TexturePaint
TrayIcon
Toolkit
Transparency