Record Class LayerColor

java.lang.Object
java.lang.Record
ke.ric.renderer.api.LayerColor
Record Components:
mode - original colour, multiplicative tint or solid replacement colour
rgb - 24-bit sRGB colour in 0x000000..0xffffff; ignored for ORIGINAL

public record LayerColor(LayerColor.Mode mode, int rgb) extends Record
Immutable RGB treatment for a recipe layer. Composition applies colour treatment, then layer brightness, then opacity. This changes the output colour, not physical lighting or surface normals. Entity-only layers still use native object-ID coverage; a solid colour does not fill the background.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Available color treatments.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LayerColor(LayerColor.Mode mode, int rgb)
    Constructs a validated immutable value.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the mode record component.
    static LayerColor
    Preserves the rendered RGB channels.
    int
    rgb()
    Returns the value of the rgb record component.
    static LayerColor
    solid(int rgb)
    Replaces RGB with one colour while retaining the layer's pixel coverage and opacity.
    static LayerColor
    tint(int rgb)
    Multiplies the rendered RGB by a tint; white preserves the input and black removes its colour.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • original

      public static LayerColor original()
      Preserves the rendered RGB channels.
      Returns:
      original-colour treatment
    • tint

      public static LayerColor tint(int rgb)
      Multiplies the rendered RGB by a tint; white preserves the input and black removes its colour.
      Parameters:
      rgb - 24-bit sRGB tint without alpha
      Returns:
      multiplicative tint treatment
      Throws:
      IllegalArgumentException - if rgb is outside 0..0xffffff
    • solid

      public static LayerColor solid(int rgb)
      Replaces RGB with one colour while retaining the layer's pixel coverage and opacity.
      Parameters:
      rgb - 24-bit sRGB output colour without alpha
      Returns:
      solid-colour treatment
      Throws:
      IllegalArgumentException - if rgb is outside 0..0xffffff
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • mode

      public LayerColor.Mode mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • rgb

      public int rgb()
      Returns the value of the rgb record component.
      Returns:
      the value of the rgb record component