P021
invalid color literal
Severity Error
A color literal must have exactly six (#RRGGBB) or eight (#RRGGBBAA) hexadecimal digits after #. Three-digit shorthands such as #2AB and non-hex characters are rejected.
Write all six digits (#22AABB), add two more for transparency (#22AABB80), or use a named color such as color.bull.
Failing example
script "Delta bars"
data vd = subscribe(data.vd)
pane p = pane(title: "Delta", height: 0.25)
plot delta = plot.histogram(title: "Delta", on: p)
on vd.close {
let d = vd.close ?? 0.0
delta.plot(d, color: d >= 0.0 ? #2AB : #F23645)
}Fixed example
script "Delta bars"
data vd = subscribe(data.vd)
pane p = pane(title: "Delta", height: 0.25)
plot delta = plot.histogram(title: "Delta", on: p)
on vd.close {
let d = vd.close ?? 0.0
delta.plot(d, color: d >= 0.0 ? #22AABB : #F23645)
}