Class HSV

java.lang.Object
  extended by HSV

public class HSV
extends Object

An instance is an immutable HSV value. If d is an HSV object, then d.h, d.s, and d.v are its h, s, and v values. But they cannot be changed.


Field Summary
 double h
          The hue.
 double s
          The saturation.
 double v
          The value.
 
Constructor Summary
HSV(double h, double s, double v)
          Constructor: the HSV triple (h mod 360, s, v) Precondition: 0 <= h, 0 <= s <= 1, 0 <= v <= 1.
 
Method Summary
 Color HSVtoRGB()
          = this color in RGB color space formulae from http://en.wikipedia.org/wiki/HSV_color_space
static HSV RGBtoHSV(Color rgb)
          = color rgb in HSV color space.
 String toString()
          = a representation of this HSV value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

h

public final double h
The hue. 0 <= h < 360


s

public final double s
The saturation. 0 <= s <= 1


v

public final double v
The value. 0 <= v <= 1

Constructor Detail

HSV

public HSV(double h,
           double s,
           double v)
Constructor: the HSV triple (h mod 360, s, v) Precondition: 0 <= h, 0 <= s <= 1, 0 <= v <= 1.

Method Detail

toString

public String toString()
= a representation of this HSV value. Each of H, S, and V is rounded to 5 characters, e.g. 135.3, 23.45, 0.003

Overrides:
toString in class Object

HSVtoRGB

public Color HSVtoRGB()
= this color in RGB color space formulae from http://en.wikipedia.org/wiki/HSV_color_space


RGBtoHSV

public static HSV RGBtoHSV(Color rgb)
= color rgb in HSV color space. formulae from en.wikipedia.org/wiki/HSV_color_space.