net.returnvoid.color

## Interface RColor

- All Known Implementing Classes:
    HSBColor, LabColor, LCHColor, RGBColor, XYZColor

      public interface RColor

  A base interface for all color spaces.
  Author:
    Diana Lange

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `RColor` | `copy()` Creates a deep copy of the object.
    `boolean` | `equals(RColor other)` Checks if the input color is equal to this object.
    `java.lang.Float` | `getAlpha()` Returns the value of alpha / transparency.
    `int` | `getColor()` Returns a int representation of the current color.
    `ColorSpace` | `getColorSpace()` Returns the color space of the color.
    `java.lang.String` | `getHexString()` Returns a String representation of the current color using hexadecimal numbers.
    `java.lang.String` | `getName()` Returns the name of the color space e.g.
    `int` | `getOpColor()` Returns a int representation of the current color - but ignoring the alpha value.
    `java.lang.String` | `getOpHexString()` Returns a String representation of the current color using hexadecimal numbers.
    `float[]` | `getValues()` Returns the color values of the current object.
    `float[]` | `getValuesNormalized()` Returns the normalized color values of the current object.
    `RColor` | `setAlpha(java.lang.Float alpha)` Sets the value of alpha / transparency.
    `HSBColor` | `toHSB()` Returns a HSBColor representation of the current color.
    `LabColor` | `toLab()` Returns a LabColor representation of the current color.
    `LCHColor` | `toLCH()` Returns a LCHColor representation of the current color.
    `RGBColor` | `toRGB()` Returns a RGBColor representation of the current color.
    `XYZColor` | `toXYZ()` Returns a XYZColor representation of the current color.

- - ### Method Detail

    - #### getValues

          float[] getValues()

      Returns the color values of the current object. Depending on the color space these are:
      [0] = red [1] = green [2] = blue [3] = alpha
      [0] = hue [1] = saturation [2] = brightness [3] = alpha
      [0] = x [1] = y [2] = z [3] = alpha
      [0] = L [1] = a [2] = b [3] = alpha
      [0] = L [1] = C [2] = Hue [3] = alpha
      Returns:
        the colors.

    - #### getValuesNormalized

          float[] getValuesNormalized()

      Returns the normalized color values of the current object. The ranges of all values will be between [0,1]. Depending on the color space the values are:
      [0] = red [1] = green [2] = blue [3] = alpha
      [0] = hue [1] = saturation [2] = brightness [3] = alpha
      [0] = x [1] = y [2] = z [3] = alpha
      [0] = L [1] = a [2] = b [3] = alpha
      [0] = L [1] = C [2] = Hue [3] = alpha
      Returns:
        the colors.

    - #### getHexString

          java.lang.String getHexString()

      Returns a String representation of the current color using hexadecimal numbers. The range will be between "FFFFFFFF" and "00000000". Example:

           RGBColor rgb = new RGBColor(255, 0, 128, 0);
           rgb.getHexString(); // "00FF0080"

      Returns:
        the color value of the object.

    - #### getOpHexString

          java.lang.String getOpHexString()

      Returns a String representation of the current color using hexadecimal numbers. The alpha value will be ignored ('Op' in method name stands for Opaque). The range will be between "FFFFFF" and "000000". Example:

           RGBColor rgb = new RGBColor(255, 0, 128, 0);
           rgb.getOpHexString(); // "FF0080"

      Returns:
        the color value of the object.

    - #### getOpColor

          int getOpColor()

      Returns a int representation of the current color - but ignoring the alpha value. The output will always be opaque ('Op' in method name stands for Opaque). The range will be between 0xFFFFFFFF and 0xFF000000. Using this, the color object can be used to set the color within Processing. Example:

           HSBColor hsb = new HSBColor(244, 100, 100, 50);
           fill(hsb.getOpColor());

      Returns:
        the color value of the object.

    - #### getColor

          int getColor()

      Returns a int representation of the current color. The range will be between 0xFFFFFFFF and 0x00000000. Using this, the color object can be used to set the color within Processing. Example:

           HSBColor hsb = new HSBColor(244, 100, 100);
           fill(hsb.getColor());

      Returns:
        the color value of the object.

    - #### setAlpha

          RColor setAlpha(java.lang.Float alpha)

      Sets the value of alpha / transparency. The range of alpha depends on the model of the color space. For RGB alpha will have a range of [0, 255]. For all other color spaces the range is [0, 100]. Zero always means that the color is completely transparent. The high value means that the color is completely opaque.
      Parameters:
        `alpha` - The value of the colors transparency.
      Returns:
        The current color object.

    - #### getAlpha

          java.lang.Float getAlpha()

      Returns the value of alpha / transparency. The range of alpha depends on the model of the color space. For RGB alpah will have a range of [0, 255]. For all other color spaces the range is [0, 100]. Zero always means that the color is completely transparent. The high value means that the color is completely opaque.
      Returns:
        The value of transparency.

    - #### getColorSpace

          ColorSpace getColorSpace()

      Returns the color space of the color.
      Returns:
        The color space.

    - #### getName

          java.lang.String getName()

      Returns the name of the color space e.g. "RGBColor"
      Returns:
        The name of the color space.

    - #### toRGB

          RGBColor toRGB()

      Returns a RGBColor representation of the current color. If the color is already a RGBColor, the original object will be return otherwise a new object will be created with converted color values. The resulting color referes to sRGB.
      Returns:
        The RGBColor of the object.

    - #### toHSB

          HSBColor toHSB()

      Returns a HSBColor representation of the current color. If the color is already a HSBColor, the original object will be return otherwise a new object will be created with converted color values.
      Returns:
        The HSBColor of the object.

    - #### toXYZ

          XYZColor toXYZ()

      Returns a XYZColor representation of the current color. If the color is already a XYZColor, the original object will be return otherwise a new object will be created with converted color values. The XYZColor refers to a D65/2° standard illuminant.
      Returns:
        The XYZColor of the object.

    - #### toLab

          LabColor toLab()

      Returns a LabColor representation of the current color. If the color is already a LabColor, the original object will be return otherwise a new object will be created with converted color values. The conversion is done using the XYZColor.REFERENCE_X,Y and Z values as specific illuminants and observers.
      Returns:
        The LabColor of the object.

    - #### toLCH

          LCHColor toLCH()

      Returns a LCHColor representation of the current color. If the color is already a LCHColor, the original object will be return otherwise a new object will be created with converted color values.
      Returns:
        The LCHColor of the object.

    - #### copy

          RColor copy()

      Creates a deep copy of the object.
      Returns:
        The copied object.

    - #### equals

          boolean equals(RColor other)

      Checks if the input color is equal to this object. Two colors are equal if they are member of the same color space and all channel values are equal.
      Parameters:
        `other` - The other color
      Returns:
        True if both colors are considered the same;