🎨Colors
Color API
File:
color‑indicator.api.ts
Predefined colors:
color.red,color.green,color.blue,color.black,color.white, etc.Utility:
rgba(r, g, b, a)→ returns"rgba(...)".
The Color API provides a simple way to work with predefined base colors and to create custom RGBA colors for your indicators. It’s often used with the Inputs API (input.color) and other style options where colors are required.
BaseColors
Description
A collection of predefined colors (hex values). These cover common colors like black, red, blue, yellow, etc.
Syntax
BaseColors.<colorName>
Available Colors
black
rgb(0, 0, 0)
gray
rgb(128, 128, 128)
silver
rgb(192, 192, 192)
white
rgb(255, 255, 255)
maroon
rgb(128, 0, 0)
red
rgb(255, 0, 0)
purple
rgb(128, 0, 128)
fuchsia
rgb(255, 0, 255)
green
rgb(0, 128, 0)
lime
rgb(0, 255, 0)
olive
rgb(128, 128, 0)
yellow
rgb(255, 255, 0)
navy
rgb(0, 0, 128)
blue
rgb(0, 0, 255)
teal
rgb(0, 128, 128)
aqua
rgb(0, 255, 255)
Example
RGBAColor
Description
Represents a color using red, green, blue, and alpha (transparency) components.
Syntax
Example
Tips
Use
colorwhen you want quick, predefined colors.Use
rgba()when you need transparency or custom mixes.
Warning
Keep "rgba" values in valid ranges (r,g,b = 0–255, a = 0–1). Out-of-range values may cause errors or unexpected colors.
Last updated