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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleblue()Returns the value of thebluerecord component.com.io7m.cxbutton.core.CxColordarker(double factor) Darken this color.final booleanIndicates whether some other object is "equal to" this one.doublegreen()Returns the value of thegreenrecord component.final inthashCode()Returns a hash code value for this object.com.io7m.cxbutton.core.CxColorlighter(double factor) Lighten this color.doublered()Returns the value of theredrecord component.com.io7m.cxbutton.core.CxColorscale(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. -
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
-
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. All components in this record class are compared with '=='. -
red
public double red()Returns the value of theredrecord component.- Returns:
- the value of the
redrecord component
-
green
public double green()Returns the value of thegreenrecord component.- Returns:
- the value of the
greenrecord component
-
blue
public double blue()Returns the value of thebluerecord component.- Returns:
- the value of the
bluerecord component
-