View on

Colors

The <color> setting allows you to configure colors. The following ways to specify colors are supported:

;; specify a color by hex code or reference a color from the color palette
<color-code>

;; specify a color by rgb. components should be in the range 0..1
(rgb <r> <g> <b>)

;; specify a color by rgba. components should be in the range 0..1
(rgba <r> <g> <b> <a>)

Examples:

;; set the color to green
color #f00

;; set the color to green
color #ff0000

;; set the color to green, 50% alpha
color #ff000080

;; set the color to red
color (rgb 1.0 0.0 0.0)

;; set the color to red, 50% alpha
color (rgba 1.0 0.0 0.0 0.5)

;; usage color number '3' from the color palette
color 3

Color Palettes

The color palette allows you to easily reference colors that are frequently used in the chart. Colors from the color palette are referenced by one-based index (see above).

You can use one of the built-in color palettes (see below) or define your own color palette using the set directive:

(set color-palette (<color>...))
(set color-palette <color-palette-name>)

For example:

;; set a custom color palette
(set color-palette (#06c #c06 #60c))

;; use the default 'fnord' color palette
(set color-palette fnord)

For another example, see: /examples/charts-custom/custom_color_palette

List of default color palettes

The following color palletes are built in and can be referenced by name:

fnord 1 2 3 4 5 6
zhang 1 2 3 4 5 6 7 8
Edit this page on GitHub