Class ColorTypes.CIELAB64

java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.colors.LongColorType
dev.lukebemish.dynamicassetgenerator.api.colors.ColorTypes.CIELAB64
Enclosing class:
ColorTypes

public static final class ColorTypes.CIELAB64 extends LongColorType
Colors encoded with the least significant 64 bits representing 4 16-bit channels: alpha, and the "L", "a", and "b" channels of a CIELAB encoding. Assumes standard illuminant D65. Coordinates are scaled by a factor of 255 before encoding, so the float version provided by lightness(long), a(long), and b(long) should be used for calculations.
  • Method Details

    • lightness

      @Contract(pure=true) public float lightness(long color)
    • a

      @Contract(pure=true) public float a(long color)
    • b

      @Contract(pure=true) public float b(long color)
    • distance

      public double distance(long color1, long color2)
      Returns:
      the Euclidean distance between two colors in CIELAB32 format, ignoring alpha
    • toARGB64

      public long toARGB64(long color)
      Specified by:
      toARGB64 in class LongColorType
      Returns:
      the color, encoded as ColorTypes.ARGB64
    • fromARGB64

      public long fromARGB64(long color)
      Specified by:
      fromARGB64 in class LongColorType
      Returns:
      the provided ColorTypes.ARGB64 color, encoded as this color type