contrib.ch.randelshofer.quaqua.colorchooser
Class HTMLColorSliderModel
java.lang.Object
contrib.ch.randelshofer.quaqua.colorchooser.ColorSliderModel
contrib.ch.randelshofer.quaqua.colorchooser.RGBColorSliderModel
contrib.ch.randelshofer.quaqua.colorchooser.HTMLColorSliderModel
public class HTMLColorSliderModel
- extends RGBColorSliderModel
ColorSliderModel for the HTML color model (red, green, blue, restricted
to values considered as web-save).
- Version:
- 1.0.1 2005-08-28 Method toWebSave generates now ARGB value instead
of just an RGB value. Method isWebSave ignores the alpha channel of a color.
1.0 May 22, 2005 Created.
- Author:
- Werner Randelshofer
Method Summary |
int |
getInterpolatedRGB(int component,
float value)
Returns an interpolated RGB value by using the values of the color
components of this ColorSliderModel except for the component specified
as an argument. |
int |
getRGB()
|
protected int |
getRGB(int r,
int g,
int b)
|
static boolean |
isWebSave(int rgb)
|
boolean |
isWebSaveOnly()
|
void |
setRGB(int rgb)
|
void |
setWebSaveOnly(boolean b)
|
int |
toRGB(int[] values)
|
static int |
toWebSave(int rgb)
|
Methods inherited from class contrib.ch.randelshofer.quaqua.colorchooser.ColorSliderModel |
addChangeListener, addColorSlider, configureColorSlider, fireColorChanged, fireStateChanged, getBoundedRangeModel, getColor, getComponentCount, getValue, removeChangeListener, removeColorSlider, setColor, setValue, unconfigureColorSlider |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HTMLColorSliderModel
public HTMLColorSliderModel()
- Creates a new instance.
getRGB
public int getRGB()
- Overrides:
getRGB
in class RGBColorSliderModel
getInterpolatedRGB
public int getInterpolatedRGB(int component,
float value)
- Description copied from class:
ColorSliderModel
- Returns an interpolated RGB value by using the values of the color
components of this ColorSliderModel except for the component specified
as an argument. For this component the ratio between zero
and the maximum of its BoundedRangeModel is used.
- Overrides:
getInterpolatedRGB
in class ColorSliderModel
getRGB
protected int getRGB(int r,
int g,
int b)
- Overrides:
getRGB
in class RGBColorSliderModel
setRGB
public void setRGB(int rgb)
- Overrides:
setRGB
in class RGBColorSliderModel
toRGB
public int toRGB(int[] values)
- Overrides:
toRGB
in class RGBColorSliderModel
setWebSaveOnly
public void setWebSaveOnly(boolean b)
isWebSaveOnly
public boolean isWebSaveOnly()
isWebSave
public static boolean isWebSave(int rgb)
toWebSave
public static int toWebSave(int rgb)