Class ColorTypes.HSL32

Enclosing class:
ColorTypes

public static final class ColorTypes.HSL32 extends IntColorType.HueIntColorType
Colors encoded with the least significant 32 bits representing 4 8-bit channels: alpha, hue, saturation, and lightness.
  • Method Details

    • saturation

      @Contract(pure=true) public int saturation(int color)
    • lightness

      @Contract(pure=true) public int lightness(int color)
    • makeChroma

      protected float makeChroma(int color)
      Specified by:
      makeChroma in class IntColorType.HueIntColorType
      Returns:
      the chroma from 0 to 1 given a color
    • makeMatch

      protected float makeMatch(int color, float chroma)
      Specified by:
      makeMatch in class IntColorType.HueIntColorType
      Returns:
      what needs to be added to each 0 to 1 channel to provide the proper value, given a full color and chroma
    • makeColor

      protected int makeColor(int alpha, int hue, float chroma, float xMin, float xMax)
      Description copied from class: IntColorType.HueIntColorType
      Finalized encoding of a color given some parameters.
      Specified by:
      makeColor in class IntColorType.HueIntColorType
      Parameters:
      alpha - alpha value, from 0 to 255
      hue - hue, from 0 to 255
      chroma - chroma, from 0 to 1
      xMin - minimum value of RGB channels, from 0 to 1
      xMax - maximum value of RGB channels, from 0 to 1
      Returns:
      an encoded color