Record Class Color
java.lang.Object
java.lang.Record
dev.pfaff.altargui.types.Color
A type representing an RGBA color with 8-bit channels.
Until value classes are available for use, avoid storing instances except in static final
or other
long-lived fields.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
abgr()
int
alpha()
int
argb()
Returns the colorRgba in ARGB format.final boolean
Indicates whether some other object is "equal to" this one.static Color
fromArgb
(int argb) static Color
fromRgb
(int rgb) static Color
fromRgb
(int r, int g, int b) static Color
fromRgba
(int rgba) static Color
fromRgba
(int r, int g, int b, int a) final int
hashCode()
Returns a hash code value for this object.int
rgb()
int
rgba()
Returns the value of thergba
record component.toString()
Returns a string representation of this record class.withAlpha
(int a)
-
Field Details
-
WHITE
-
TRANSPARENT
-
-
Constructor Details
-
Color
public Color(int rgba) Creates an instance of aColor
record class.- Parameters:
rgba
- the value for thergba
record component
-
-
Method Details
-
fromRgba
-
fromRgba
-
fromRgb
-
fromRgb
-
fromArgb
-
argb
public int argb()Returns the colorRgba in ARGB format. -
abgr
public int abgr() -
alpha
public int alpha() -
rgb
public int rgb() -
withAlpha
-
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 '=='. -
rgba
public int rgba()Returns the value of thergba
record component.- Returns:
- the value of the
rgba
record component
-