Sidechair

color.* constants

Browse the reference

The seventeen named colours: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white and yellow.

Try it in the editor

Each color.* constant is a const color, so it is accepted anywhere a color argument is: plot(color = ...), bgcolor, plotshape, label.new, line.new, box.new and the colour of an input.color default. They are fully opaque. To fade one, wrap it in color.new(color.red, 70), where 70 is the transparency in percent.

A colour is a value like any other. You can pick between two with a ternary, build one from channels with color.rgb, or blend between two with color.from_gradient. A colour that is na draws nothing, which is how a plot hides itself on bars where a condition is false.

Constants

NameValueDescription
color.aqua#00BCD4A cyan-blue.
color.black#363A45A soft near-black.
color.blue#2962FFA saturated blue.
color.fuchsia#E040FBA bright magenta-pink.
color.gray#787B86A mid gray.
color.green#4CAF50A medium green.
color.lime#00E676A vivid green.
color.maroon#880E4FA dark red-purple.
color.navy#311B92A deep blue-violet.
color.olive#808000A dark yellow-green.
color.orange#FF9800A warm orange.
color.purple#9C27B0A medium purple.
color.red#F23645A strong red.
color.silver#B2B5BEA light gray.
color.teal#089981A blue-green.
color.white#FFFFFFPure white.
color.yellow#FDD835A warm yellow.

Remarks

  • The hex values in the list are the opaque palette values. Transparency is not part of the constant.
  • Colours given as plain strings such as "red" are not valid in Pine; use the constant or a #RRGGBB literal.
  • On Sidechair: color.blue draws as #2196F3 instead of #2962FF; the other sixteen constants match the values listed here.

Example

Pine ScriptPalette on a chartOpen in editor
//@version=6
indicator("Palette", overlay = true)
fast = ta.ema(close, 9)
slow = ta.ema(close, 21)
plot(fast, "Fast", color.orange, 2)
plot(slow, "Slow", color.navy, 2)
bgcolor(fast > slow ? color.new(color.green, 88) : color.new(color.red, 88))

See also

Runs on Sidechair