|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.monitorenter.gui.util.HSBColor
public class HSBColor
Color that internally works with the Hue Saturation Luminance color space.
Field Summary | |
---|---|
protected double |
m_alpha
The unused alpha channel between 0 and 255: stored here for allow java.awt.Color instances to be transformed to instances of this class and be re - transformed with preserving their alpha setting. |
protected double |
m_hue
Hue value between 0.0 and 1.0. |
protected double |
m_lum
Luminance value between 0.0 and 1.0. |
protected double |
m_sat
Saturation value between 0.0 and 1.0. |
Constructor Summary | |
---|---|
HSBColor(java.awt.Color rgbcolor)
Creates an instance transformed from the rgb color. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clone implementation. |
boolean |
equals(java.lang.Object obj)
|
java.awt.Color |
getRGBColor()
Returns the transformation of this color to the rgb color. |
int |
hashCode()
|
static HSBColor |
rgbToHSB(java.awt.Color color)
Inspired by float[] java.awt.Color.RGBtoHSB(int r,int g, int b, float[]hsbvals)
except that algorithm is tuned Testing results showed about 25% speed up. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double m_hue
protected double m_lum
protected double m_sat
protected double m_alpha
Constructor Detail |
---|
public HSBColor(java.awt.Color rgbcolor)
rgbcolor
- standard java rgb color.Method Detail |
---|
public static HSBColor rgbToHSB(java.awt.Color color)
float[] java.awt.Color.RGBtoHSB(int r,int g, int b, float[]hsbvals)
except that algorithm is tuned
color
- the java.awt.Color
(that follows the RGB model) and
should be transformed to a color instance in the
hue-saturation-luminance model.
public java.lang.Object clone()
Following statements are true:
x.clone() != x
x.clone().getClass() == x.getClass()
x.clone().equals(x)
A deep copy of this HSBColor is returned.
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.awt.Color getRGBColor()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |