# Class Sorter.SorterColor

public class SorterColor
extends Color

A subclass of java.awt.Color that can be recursively split. SorterColor has a notion of a single integer, RBG value with the addition that the color value is contained in a "spectrum". That is, the color value is specified within a lower and upper value bounds.

##

hi
  The high end of the spectrum
lo
  The low end of the spectrum
mask
  This mask represents the java
value
  The 24 bit RGB color value of thsi color

##

SorterColor (int, int, int)
  The constructor for the class

##

getHi ()
  Accessor method for the high end of the spectrum
getHiSplit ()
  Returns a new SorterColor with a value halfway between the current value and the high end of the spectrum
getLo ()
  Accessor method for the low end of the spectrum
getLoSplit ()
  Returns a new SorterColor with a value halfway between the current value and the lo end of the spectrum
getValue ()
  Accessor method for the color value
join (SorterColor)
  "Joins" two SorterColors together to form a new SorterColor with a spectrum from

##

value

    int value

  The 24 bit RGB color value of thsi color.

hi

    int hi

  The high end of the spectrum

lo

    int lo

  The low end of the spectrum

mask

    static int mask

  This mask represents the java.awt.Color value where the 24 color bits are all zero but the top 8 bits are all 1's. java.awt.Color expects to see RGB color values where the upper 8 bits are all 1's. This mask is equal to the value returned java.awt.Color.black.getRGB()

##

SorterColor

    public  SorterColor(int value, int lo, int hi)

  The constructor for the class

  Parameters:
    value - The 24-bit RGB color value to be set to.
    lo - the low end of the spectrum for this object. A 24-bit RGB value.
    hi - the high end of the spectrum for this object. A 24-bit RGB value.

##

getValue

    int getValue()

  Accessor method for the color value.

  Returns:

getLo

    int getLo()

  Accessor method for the low end of the spectrum.

getHi

    int getHi()

  Accessor method for the high end of the spectrum.

getLoSplit

    SorterColor getLoSplit()

  Returns a new SorterColor with a value halfway between the current value and the lo end of the spectrum. The new SorterColor has a spectrum from the low end of the current spectrum to the current value.

getHiSplit

    SorterColor getHiSplit()

  Returns a new SorterColor with a value halfway between the current value and the high end of the spectrum. The new SorterColor has a spectrum from the high end of the current spectrum to the current value.

join

    SorterColor join(SorterColor sc)

  "Joins" two SorterColors together to form a new SorterColor with a spectrum from the lowest spectrum end to the highest spectrum end. The new value is halfway between its new spectrum. Note: sc.splitLo().join(sc.splitHi()) will return an instance equivalent to sc.

  Parameters:
    sc - The SorterColor to join to.
  Returns:
    A new SorterColor with a jined spectrum and value.