ColorRef. A ColorRef does not only hold a color: it holds where the color comes from. The chart resolves it when it draws, so a point colored with “the first color of this series” follows the settings of the user, and a theme color follows the light and the dark theme, without recalculating the indicator.
This is also what lets an indicator run on the server, which knows neither the theme nor the settings of each user.
Sources of a color
- Literal
- Theme
- Series
- Parameter
A fixed color.
Changing a color
Defaults for series and parameters
Use theme colors as defaults, so the indicator looks right on every theme the first time it is added:Where colors are used
A point without a color of its own takes the color of its series. Set point colors only when they change from point to point, and set
OverrideAutoColor = true on the series attribute when you do.