Skip to main content

Overview

Colors in the Darvas indicator API are expressed as 8-character hex strings in #RRGGBBAA format, where the last two characters are the alpha channel (FF = fully opaque, 00 = fully transparent). The color namespace provides named constants and construction helpers.

Constructing colors

string
Create a color from a hex string with optional transparency (0-100, where 100 = fully transparent).
For the full list of color.* functions including color.rgb, color.from_gradient, color.r, color.g, color.b, and color.t, see the custom indicator spec.

Named color constants

The runtime exposes 24 named colors via the color namespace:

Dynamic coloring example

Transparency with color.new

Plot basics

color option for plot series.

hline, fill, bgcolor

bgcolor and barcolor use the same color format.

Line entity

Entity colors also use #RRGGBBAA format.