java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.colors.LongColorType
Direct Known Subclasses:
ColorTypes.CIELAB64, LongColorType.BlendingLongColorType, LongColorType.HueLongColorType

public abstract class LongColorType extends Object
A type of color that has 4 16-bit channels, the first of which encodes the alpha value.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    A color type whose channels can be linearly blended by alpha blending.
    static class 
    A color type that encodes hue and chroma-related values.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
    alpha(long color)
     
    long
    color(int alpha, int first, int second, int third)
    Constructs a new color from channel values between 0x0000 and 0xFFFF.
    protected final int
    first(long color)
     
    abstract long
    fromARGB64(long color)
     
    protected final int
    second(long color)
     
    protected final int
    third(long color)
     
    abstract long
    toARGB64(long color)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LongColorType

      public LongColorType()
  • Method Details

    • alpha

      @Contract(pure=true) public final int alpha(long color)
    • first

      @Contract(pure=true) protected final int first(long color)
    • second

      @Contract(pure=true) protected final int second(long color)
    • third

      @Contract(pure=true) protected final int third(long color)
    • toARGB64

      @Contract(pure=true) public abstract long toARGB64(long color)
      Returns:
      the color, encoded as ColorTypes.ARGB64
    • fromARGB64

      @Contract(pure=true) public abstract long fromARGB64(long color)
      Returns:
      the provided ColorTypes.ARGB64 color, encoded as this color type
    • color

      @Contract(pure=true) public long color(int alpha, int first, int second, int third)
      Constructs a new color from channel values between 0x0000 and 0xFFFF.
      Parameters:
      alpha - the alpha channel, between 0x0000 and 0xFFFF
      first - the first channel, between 0x0000 and 0xFFFF
      second - the second channel, between 0x0000 and 0xFFFF
      third - the third channel, between 0x0000 and 0xFFFF
      Returns:
      a new color, from the provided channels