public class HSBColor
extends java.lang.Object
The HSB color space is a color space that describes colors in terms of hue, saturation, and brightness (also
called value). It is a nonlinear transformation of the RGB color space. The HSB color space is often used in
color selection tools, such as in Photoshop.
The HSB color space can be visualized as a double cone with the primary colors red, green, and blue at the
vertices of the triangle at the bottom. The brightness is represented by the vertical axis. The hue is the
angle of the vector from the origin to the point on the cone. The saturation is the distance from the origin.
| Modifier and Type | Field and Description |
|---|---|
float |
alpha |
float |
brightness |
float |
hue |
float |
saturation |
| Constructor and Description |
|---|
HSBColor(java.awt.Color color)
Creates a new HSBColor from the given color.
|
HSBColor(float hue,
float saturation,
float brightness,
float alpha)
Creates a new HSBColor from the given hue, saturation, brightness, and alpha values.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.Color |
getColor() |
void |
setColor(java.awt.Color color)
Sets the color of this HSBColor to the given color, see
Color. |
void |
setColor(float hue,
float saturation,
float brightness)
Sets the color of this HSBColor to the given hue, saturation, brightness, and alpha values.
|
void |
setColor(float hue,
float saturation,
float brightness,
float alpha)
Sets the color of this HSBColor to the given hue, saturation, brightness, and alpha values.
|
public float hue
public float saturation
public float brightness
public float alpha
public HSBColor(java.awt.Color color)
color - The color to create the HSBColor from.public HSBColor(float hue,
float saturation,
float brightness,
float alpha)
hue - The hue of the color.saturation - The saturation of the color.brightness - The brightness of the color.alpha - The alpha of the color.public java.awt.Color getColor()
Color instance with the same values as this HSBColor.public void setColor(java.awt.Color color)
Color.color - The color to set.public void setColor(float hue,
float saturation,
float brightness)
hue - The hue of the color.saturation - The saturation of the color.brightness - The brightness of the color.public void setColor(float hue,
float saturation,
float brightness,
float alpha)
hue - The hue of the color.saturation - The saturation of the color.brightness - The brightness of the color.alpha - The alpha of the color.