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
ConstructorDescriptionInitializes 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 TypeMethodDescriptionfloat
alpha()
int
float
blue()
int
blueByte()
copy()
darker
(float percentage) float
green()
int
lighter
(float percentage) static MutableColor
of
(ColorValue color, LightDarkMode mode) Resolves a symbolic color value and copies it into a new mutable color.static MutableColor
ofArgb32
(int packedColor) static MutableColor
ofBytes
(int r, int g, int b) static MutableColor
ofBytes
(int r, int g, int b, int a) float
red()
int
redByte()
int
resolve
(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) int
toAbgr32()
int
toArgb32()
-
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:ColorValue
Resolve as ARGB 32-bit.- Specified by:
resolve
in interfaceColorValue
-