Class LongColorType.HueLongColorType

java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.colors.LongColorType
dev.lukebemish.dynamicassetgenerator.api.colors.LongColorType.HueLongColorType
Direct Known Subclasses:
ColorTypes.HSL64, ColorTypes.HSV64
Enclosing class:
LongColorType

public abstract static class LongColorType.HueLongColorType extends LongColorType
A color type that encodes hue and chroma-related values.
  • Constructor Details

    • HueLongColorType

      public HueLongColorType()
  • Method Details

    • makeChroma

      @Contract(pure=true) protected abstract float makeChroma(long color)
      Returns:
      the chroma from 0 to 1 given a color
    • hue

      @Contract(pure=true) public int hue(long color)
    • makeMatch

      @Contract(pure=true) protected abstract float makeMatch(long color, float chroma)
      Returns:
      what needs to be added to each 0 to 1 channel to provide the proper value, given a full color and chroma
    • 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
    • makeColor

      @Contract(pure=true) protected abstract long makeColor(int alpha, int hue, float chroma, float xMin, float xMax)
      Finalized encoding of a color given some parameters.
      Parameters:
      alpha - alpha value, from 0x0000 to 0xFFFF
      hue - hue, from 0x0000 to 0xFFFF
      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