Package ke.ric.renderer.api
Record Class LayerColor
java.lang.Object
java.lang.Record
ke.ric.renderer.api.LayerColor
- Record Components:
mode- original colour, multiplicative tint or solid replacement colourrgb- 24-bit sRGB colour in 0x000000..0xffffff; ignored for ORIGINAL
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 -
Constructor Summary
ConstructorsConstructorDescriptionLayerColor(LayerColor.Mode mode, int rgb) Constructs a validated immutable value. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.mode()Returns the value of themoderecord component.static LayerColororiginal()Preserves the rendered RGB channels.intrgb()Returns the value of thergbrecord component.static LayerColorsolid(int rgb) Replaces RGB with one colour while retaining the layer's pixel coverage and opacity.static LayerColortint(int rgb) Multiplies the rendered RGB by a tint; white preserves the input and black removes its colour.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LayerColor
Constructs a validated immutable value.- Throws:
IllegalArgumentException- if rgb is outside the 24-bit rangeNullPointerException- if mode is null
-
-
Method Details
-
original
Preserves the rendered RGB channels.- Returns:
- original-colour treatment
-
tint
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
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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
mode
Returns the value of themoderecord component.- Returns:
- the value of the
moderecord component
-
rgb
public int rgb()Returns the value of thergbrecord component.- Returns:
- the value of the
rgbrecord component
-