Package guideme.color
Class MutableColor
java.lang.Object
guideme.color.MutableColor
- All Implemented Interfaces:
ColorValue
A helper for mutating color values. The color values are stored as
float components between 0 and 1.-
Constructor Summary
ConstructorsConstructorDescriptionInitializes a mutable color that has 1 for all components.MutableColor(float r, float g, float b) Initializes a color value with alpha=1.MutableColor(float r, float g, float b, float a) -
Method Summary
Modifier and TypeMethodDescriptionfloatalpha()intfloatblue()intblueByte()copy()darker(float percentage) floatgreen()intlighter(float percentage) static MutableColorof(ColorValue color, LightDarkMode mode) Resolves a symbolic color value and copies it into a new mutable color.static MutableColorofArgb32(int packedColor) static MutableColorofBytes(int r, int g, int b) static MutableColorofBytes(int r, int g, int b, int a) floatred()intredByte()intresolve(LightDarkMode lightDarkMode) Resolve as ARGB 32-bit.setAlpha(float a) setAlphaByte(int value) setBlue(float b) setBlueByte(int value) setGreen(float g) setGreenByte(int value) setRed(float r) setRedByte(int value) inttoAbgr32()inttoArgb32()
-
Constructor Details
-
MutableColor
public MutableColor()Initializes a mutable color that has 1 for all components. -
MutableColor
public MutableColor(float r, float g, float b) Initializes a color value with alpha=1.- Parameters:
r-g-b-
-
MutableColor
public MutableColor(float r, float g, float b, float a)
-
-
Method Details
-
ofArgb32
-
ofBytes
-
ofBytes
-
of
Resolves a symbolic color value and copies it into a new mutable color. -
toArgb32
public int toArgb32() -
toAbgr32
public int toAbgr32() -
red
public float red() -
green
public float green() -
blue
public float blue() -
alpha
public float alpha() -
setRed
-
setGreen
-
setBlue
-
setAlpha
-
redByte
public int redByte() -
greenByte
public int greenByte() -
blueByte
public int blueByte() -
alphaByte
public int alphaByte() -
setRedByte
-
setGreenByte
-
setBlueByte
-
setAlphaByte
-
lighter
-
darker
-
copy
-
resolve
Description copied from interface:ColorValueResolve as ARGB 32-bit.- Specified by:
resolvein interfaceColorValue
-