org.faceless.pdf2

## Class LabColorSpace

- java.lang.Object
- - java.awt.color.ColorSpace
  - - org.faceless.pdf2.LabColorSpace

- All Implemented Interfaces:
    Serializable

      public final class LabColorSpace
      extends ColorSpace

  Represents the CIE 1976 (L*, a*, b*) or "CIELAB" device-independent ColorSpace. Colors from this ColorSpace can be used like any other color from the RGB or `CMYK` ColorSpaces, although they are most useful when specifying alternates for `Spot` colors.

  Technically you also need to specify the CIE illuminant to completely define the color, but usually the intention is to define an exact color for print output, so the D50 illuminant is assumed. If you require a D65 illuminant the `getColorD65(float, float, float)` method can be called.

  For example, here are three ways to specify the Color "PANTONE® Reflex Blue C" - the first using L*a*b values in CIELAB space with a D50 illuminant, the second in the same space with a D65 illuminant, and the third using a CMYK process colorspace. Note that the third approach is an approximation only as this particular shade can not normally be reproduced using a four-color process, which is why using Lab colors as alternatives for Spot colors is the best option if possible.

       Color blue = SpotColorSpace.getInstance("Pantone Reflex Blue C", LabColorSpace.getColor(19, 26, 68));
       Color blue = SpotColorSpace.getInstance("Pantone Reflex Blue C", LabColorSpace.getColorD65(26.18, 18.64, -59.93));
       Color blue = SpotColorSpace.getInstance("Pantone Reflex Blue C", CMYKColorSpace.getColor(1, 0.73f, 0, 0.02f));

  Since:
    2.14.1
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class java.awt.color.ColorSpace

      `CS_CIEXYZ, CS_GRAY, CS_LINEAR_RGB, CS_PYCC, CS_sRGB, TYPE_2CLR, TYPE_3CLR, TYPE_4CLR, TYPE_5CLR, TYPE_6CLR, TYPE_7CLR, TYPE_8CLR, TYPE_9CLR, TYPE_ACLR, TYPE_BCLR, TYPE_CCLR, TYPE_CMY, TYPE_CMYK, TYPE_DCLR, TYPE_ECLR, TYPE_FCLR, TYPE_GRAY, TYPE_HLS, TYPE_HSV, TYPE_Lab, TYPE_Luv, TYPE_RGB, TYPE_XYZ, TYPE_YCbCr, TYPE_Yxy`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `float[]` | `fromCIEXYZ(float[] xyz)`
    `float[]` | `fromRGB(float[] rgb)`
    `static Color` | `getColor(float L, float a, float b)` Get a Color in the standard CIELAB D50 ColorSpace, based on the D50 illuminant.
    `static Color` | `getColorD65(float L, float a, float b)` Get a Color in the CIELAB ColorSpace, based on the D65 illuminant.
    `int` | `hashCode()`
    `float[]` | `toCIEXYZ(float[] lab)`
    `float[]` | `toRGB(float[] lab)`
    `String` | `toString()`

    - ### Methods inherited from class java.awt.color.ColorSpace

      `getInstance, getMaxValue, getMinValue, getName, getNumComponents, getType, isCS_sRGB`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toRGB

          public float[] toRGB(float[] lab)

      Specified by:
        `toRGB` in class `ColorSpace`

    - #### fromRGB

          public float[] fromRGB(float[] rgb)

      Specified by:
        `fromRGB` in class `ColorSpace`

    - #### fromCIEXYZ

          public float[] fromCIEXYZ(float[] xyz)

      Specified by:
        `fromCIEXYZ` in class `ColorSpace`

    - #### toCIEXYZ

          public float[] toCIEXYZ(float[] lab)

      Specified by:
        `toCIEXYZ` in class `ColorSpace`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getColor

          public static Color getColor(float L,
                                       float a,
                                       float b)

      Get a Color in the standard CIELAB D50 ColorSpace, based on the D50 illuminant. This is usually the correct method to get a Lab color for use as an alternate for a `SpotColorSpace` Spot color, for instance.
      Parameters:
        `L` - the "L" value, which will be clipped to the range 0..100
        `a` - the "a" value, which will be clipped to the range -100..100
        `b` - the "b" value, which will be clipped to the range -100..100

    - #### getColorD65

          public static Color getColorD65(float L,
                                          float a,
                                          float b)

      Get a Color in the CIELAB ColorSpace, based on the D65 illuminant.
      Parameters:
        `L` - the "L" value, which will be clipped to the range 0..100
        `a` - the "a" value, which will be clipped to the range -100..100
        `b` - the "b" value, which will be clipped to the range -100..100

Copyright © 2001-2015 Big Faceless Organization