Class IntColorType.HueIntColorType

java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.colors.IntColorType
dev.lukebemish.dynamicassetgenerator.api.colors.IntColorType.HueIntColorType
Direct Known Subclasses:
ColorTypes.HSL32, ColorTypes.HSV32
Enclosing class:
IntColorType

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

    • HueIntColorType

      public HueIntColorType()
  • Method Details

    • makeChroma

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

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

      @Contract(pure=true) protected abstract float makeMatch(int 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
    • toARGB32

      public int toARGB32(int color)
      Specified by:
      toARGB32 in class IntColorType
      Returns:
      the color, encoded as ColorTypes.ARGB32
    • fromARGB32

      public int fromARGB32(int color)
      Specified by:
      fromARGB32 in class IntColorType
      Returns:
      the provided ColorTypes.ARGB32 color, encoded as this color type
    • makeColor

      @Contract(pure=true) protected abstract int makeColor(int alpha, int hue, float chroma, float xMin, float xMax)
      Finalized encoding of a color given some parameters.
      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