setColor method
Sets the current drawing color using individual RGBA components.
This color will be used for subsequent drawing operations that don't specify per-vertex colors or use textures that override it.
r
: Red component (0.0 to 1.0). Defaults to 1.0.g
: Green component (0.0 to 1.0). Defaults to 1.0.b
: Blue component (0.0 to 1.0). Defaults to 1.0.a
: Alpha component (0.0 to 1.0). Defaults to 1.0.
Implementation
void setColor([double r = 1.0, double g = 1.0, double b = 1.0, double a = 1.0]) {
_currentColor.setValues(r, g, b, a);
_encodedColor = _currentColor.toUint8();
}