Record Class RenderColor

java.lang.Object
java.lang.Record
com.render.api.RenderColor

public record RenderColor(int argb) extends Record
Immutable ARGB color value used across the public render API.
  • Field Details

  • Constructor Details

    • RenderColor

      public RenderColor(int argb)
      Creates an instance of a RenderColor record class.
      Parameters:
      argb - the value for the argb record component
  • Method Details

    • argb

      public static RenderColor argb(int argb)
    • rgb

      public static RenderColor rgb(int rgb)
    • argb

      public static RenderColor argb(int alpha, int red, int green, int blue)
    • rgba

      public static RenderColor rgba(int red, int green, int blue, int alpha)
    • rgb

      public static RenderColor rgb(int red, int green, int blue)
    • rgba

      public static RenderColor rgba(float red, float green, float blue, float alpha)
    • rgb

      public static RenderColor rgb(float red, float green, float blue)
    • hex

      public static RenderColor hex(String value)
    • preset

      public static RenderColor preset(RenderColor.Preset preset)
    • toArgb

      public int toArgb()
    • alpha

      public int alpha()
    • red

      public int red()
    • green

      public int green()
    • blue

      public int blue()
    • withAlpha

      public RenderColor withAlpha(int alpha)
    • withOpacity

      public RenderColor withOpacity(float opacity)
    • 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. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      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.
    • argb

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