Modifying a Colourbar .ducolbar File

Colour bars are exported as text files (named .ducolbar) and can be manipulated using a text editor.

Insight keeps colourbars stored in the DUG Insight software installation folder e.g. C:\Program Files (x86)\DownUnder GeoSolutions\Insight (version)\colourbars.

A colourbar file consists of:

  • Optional comment lines, starting with the '#' character
  • A line indicating the start of data rows
    • dim1
  • Two or more rows containing colour node definitions: e.g.
    • 0.0 rgb(0, 0, 0)
    • 1.0 rgb(255, 255, 255)

Modifying a colourbar .ducolbar file

Each colour node consists of:

  • a proportion from 0-1, where 0 is the minimum value and 1 is the maximum value
  • red-green-blue triplet or a red-green-blue-alpha quad
  • red-green-blue triplets are a single, solid colour
    • rgb(red-value, green-value, blue-value)
  • red-green-blue-alpha quads are a single, solid colour with transparency
    • The word 'alpha' denotes the transparency/opacity of the colour range.
      • rgba(red-value, green-value, blue-value, alpha-value)
    • each colour value ranges from 0 to 255 (0 = no output, 255 = max output)
    • the alpha value ranges from 0 to 255 (0 = transparent, 255 = opaque)
    • e.g.
      • 50% grey: rgb(128,128,128)
      • 100% red: rgb(255,0,0)
      • 50% transparent red: rgba(255,0,0,127)
      • black: rgb(0,0,0)
      • white: rgb(255,255,255)

When the colourbar is applied to data, the colour at 0 is mapped to the range minimum, and the colour at 1 is mapped to the range maximum.

Examples of a .ducolbar file

dim1
    0.0 rgb(153, 0, 0)
    0.5 rgb(255, 255, 255)
    1.0 rgb(15, 15, 157)
Click to copy
dim1
    0.0 rgba(51, 51, 255, 99)
    0.216 rgba(73, 73, 227, 163)
    0.581 rgba(255, 255, 0, 223)
    1.0 rgb(255, 0, 0)
Click to copy