color
.color base:{Color = Color(0, 0, 0)} \
red:{Int = base.red} \
green:{Int = base.green} \
blue:{Int = base.blue} \
alpha:{Number = base.alpha}
-> ColorContent copied to clipboard
Builds a color, either from scratch or from an existing one. Each given component replaces the corresponding one of base, while the others are kept. Without a base, unspecified components start from opaque black.
.color red:{66} green:{144} blue:{245}Content copied to clipboard
Builds rgb(66, 144, 245).
.text {Faded} color:{.color {#4290F5} alpha:{0.5}}Content copied to clipboard
Displays the text at half opacity.
.var {brand} {#4290F5}
.container background:{.brand::color alpha:{0.25}}Content copied to clipboard
Derives a translucent variant of a stored color.
Return
the resulting color
Parameters
base
- Optional
the color to start from. Opaque black if unset
red
- Optional
- Likely named
red component, 0-255
green
- Optional
- Likely named
green component, 0-255
blue
- Optional
- Likely named
blue component, 0-255
alpha
- Optional
- Likely named
alpha component, 0-1
Throws
if a component is out of range