|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrainbowvis.Rainbow
public class Rainbow
The Rainbow class by default maps the range 0 to 100 (inclusive) to the colours of the rainbow (i.e., a gradient transitioning from red to yellow to lime to blue)
Constructor Summary | |
---|---|
Rainbow()
Constructor. |
Method Summary | |
---|---|
java.lang.String |
colorAt(double number)
Same as colourAt(double number) |
java.lang.String |
colourAt(double number)
Returns the hex colour corresponding to the number. |
void |
setNumberRange(double minNumber,
double maxNumber)
Sets the number range of the Rainbow object. |
void |
setSpectrum(java.lang.String... spectrum)
Sets the spectrum of the Rainbow object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Rainbow()
Method Detail |
---|
public java.lang.String colourAt(double number)
number
- The number for which you want to find the corresponding colour
public void setSpectrum(java.lang.String... spectrum) throws HomogeneousRainbowException, InvalidColourException
rainbow.setSpectrum("red", "yellow", "white");
makes the "Rainbow" a colour gradient from red to yellow to white.
spectrum
- Two or more Strings representing HTML colours,
or pass in a whole String array of length 2 or greater
HomogeneousRainbowException
- if there is less than two arguments
InvalidColourException
- if one of the arguments is an invalid colourpublic void setNumberRange(double minNumber, double maxNumber) throws NumberRangeException
minNumber
- The minimum number of the number rangemaxNumber
- The maximum number of the number range
NumberRangeException
- if minNumber is greater than maxNumberpublic java.lang.String colorAt(double number)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |