Package com.io7m.idstore.server.api
Record Class IdColor
java.lang.Object
java.lang.Record
com.io7m.idstore.server.api.IdColor
- Record Components:
red
- The red channelgreen
- The green channelblue
- The blue channel
A color.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
blue()
Returns the value of theblue
record component.com.io7m.cxbutton.core.CxColor
darker
(double factor) Darken this color.boolean
Indicates whether some other object is "equal to" this one.double
green()
Returns the value of thegreen
record component.int
hashCode()
Returns a hash code value for this object.com.io7m.cxbutton.core.CxColor
lighter
(double factor) Lighten this color.double
red()
Returns the value of thered
record component.com.io7m.cxbutton.core.CxColor
scale
(double factor) Scale this color by the given factor.toString()
Returns a string representation of this record class.
-
Constructor Details
-
IdColor
public IdColor(double red, double green, double blue) A color.- Parameters:
red
- The red channelgreen
- The green channelblue
- The blue channel
-
-
Method Details
-
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. -
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 '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
scale
public com.io7m.cxbutton.core.CxColor scale(double factor) Scale this color by the given factor. Factors less than 1.0 make the color darker. Factors greater than 1.0 make the color lighter.- Parameters:
factor
- The factor- Returns:
- The color scaled
-
lighter
public com.io7m.cxbutton.core.CxColor lighter(double factor) Lighten this color.- Parameters:
factor
- The factor- Returns:
- A lightened color
-
darker
public com.io7m.cxbutton.core.CxColor darker(double factor) Darken this color.- Parameters:
factor
- The factor- Returns:
- A darkened color
-
red
public double red()Returns the value of thered
record component.- Returns:
- the value of the
red
record component
-
green
public double green()Returns the value of thegreen
record component.- Returns:
- the value of the
green
record component
-
blue
public double blue()Returns the value of theblue
record component.- Returns:
- the value of the
blue
record component
-