Record Class Color
java.lang.Object
java.lang.Record
com.zenith.util.Color
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintb()Returns the value of thebrecord component.final booleanIndicates whether some other object is "equal to" this one.static ColorfromInt(int rgb) intg()Returns the value of thegrecord component.intgetRGB()final inthashCode()Returns a hash code value for this object.intr()Returns the value of therrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
BLACK
-
-
Constructor Details
-
Color
public Color(int r, int g, int b) Creates an instance of aColorrecord class.- Parameters:
r- the value for therrecord componentg- the value for thegrecord componentb- the value for thebrecord component
-
-
Method Details
-
getRGB
public int getRGB() -
fromInt
-
toString
-
hashCode
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
r
public int r()Returns the value of therrecord component.- Returns:
- the value of the
rrecord component
-
g
public int g()Returns the value of thegrecord component.- Returns:
- the value of the
grecord component
-
b
public int b()Returns the value of thebrecord component.- Returns:
- the value of the
brecord component
-