java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.colors.IntColorType
Direct Known Subclasses:
ColorTypes.CIELAB32, IntColorType.BlendingIntColorType, IntColorType.HueIntColorType

public abstract class IntColorType extends Object
A type of color that has 4 8-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(int color)
     
    final int
    color(int alpha, int first, int second, int third)
    Constructs a new color from channel values between 0 and 255.
    protected final int
    first(int color)
     
    abstract int
    fromARGB32(int color)
     
    protected final int
    second(int color)
     
    protected final int
    third(int color)
     
    abstract int
    toARGB32(int color)
     

    Methods inherited from class java.lang.Object

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

    • IntColorType

      public IntColorType()
  • Method Details

    • alpha

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

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

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

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

      @Contract(pure=true) public abstract int toARGB32(int color)
      Returns:
      the color, encoded as ColorTypes.ARGB32
    • fromARGB32

      @Contract(pure=true) public abstract int fromARGB32(int color)
      Returns:
      the provided ColorTypes.ARGB32 color, encoded as this color type
    • color

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