Color class represents an RGBA color value where each channel (r, g, b, a) is a floating-point number in the range 0 to 1. You use Color whenever you need to tint objects, set dialog backgrounds, drive visual effects, or blend between two colors over time. RollingQuest also provides a collection of pre-built static colors — like Color.red and Color.white — so you don’t have to remember the exact component values for common colors. All component properties are read-only after construction; create a new Color to change a value.
Constructors
Instance Properties
You can also index a
Color by integer (c[1] → R, c[2] → G, c[3] → B, c[4] → A) for both read and write access.
Static Color Constants
These pre-built colors are available without constructing anything.Static Methods
lerp
Linearly interpolates between color a and color b by the clamped factor t (0 → a, 1 → b). Each channel is interpolated independently.
lerpUnclamped
Same as lerp but t is not clamped, allowing extrapolation beyond the two endpoints.
Usage Examples
Creating custom colors
Blending between two colors over time
Using a Color with the Dialog namespace
Pass aColor value as the background parameter when showing a dialog so your UI fits the scene’s mood.