java.io.Serializable
, java.lang.Cloneable
public class HSBColor
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Modifier and Type | Field | Description |
---|---|---|
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 | Description |
---|---|
HSBColor(java.awt.Color rgbcolor) |
Creates an instance transformed from the rgb color.
|
Modifier and Type | Method | Description |
---|---|---|
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. |
protected double m_hue
protected double m_lum
protected double m_sat
protected double m_alpha
public HSBColor(java.awt.Color rgbcolor)
rgbcolor
- standard java rgb color.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()
Copyright © 2001 - 2010 LGPL, All Rights Footloose.