SAOTk Reference Manual
Table of Contents

SAOTk Colorbar Widget

The Colorbar widget controls the color environment for the application. Pseudocolor8, Truecolor8, Truecolor16, and Truecolor24 visuals are supported.

The Colorbar widget supports a variety of colormap formats including colormaps from SAOImage, SAOtng/Ximtool, and other display programs. There are a number of built-in maps, and new maps may be loaded, edited, and saved.

In a Pseudocolor environment, the widget will request a minimum number of colors in the default colormap. If these are not available, it will use a private colormap. The private colormap will be populated with colors from the current colormap to minimize color flashing.

synopsis

colorbarpseudocolor8
colorbartruecolor8
colorbartruecolor16
colorbartruecolor24

Create magnifier canvas widget for pseudocolor or truecolor visual.
Syntax:  standard canvas widget options, see canvas(n) for more info.
            -width           width of magnifier, default 512
            -height          height of magnifier, default 22
            -x                   location of anchor point in canvas, default 1
            -y                   location of anchor point in canvas, default 1
            -anchor        anchor mode, default nw
            -tags             canvas tag
            -command  tcl command for this widget, default 'colorbar'
            -min              minimum number of colors, default 80
            -max             maximum number of colors, default 200
            -private        (colorbarpseudocolor8 only) use private colormap, default false
            -privatecolors (colorbarpseudocolor8 only) number of colors in private colormap

Example: create colorbarpseudocolor8 -width 500 -height 20 -private
         create colorbartruecolor16 -width 500 -height 20

commands

  • adjust
  • get colormap
  • get height
  • get id
  • get invert
  • get name
  • get file name
  • get width
  • hide
  • itt
  • list
  • load
  • map
  • reset
  • save
  • set colormap
  • show
  • version
  • adjust

    Adjust the contrast and bias for the current distribution of colors within the colorbar.
    Syntax:  adjust numeric numeric
    Example: colorbar adjust 1 .5

    get colormap

    Returns the following information: colormap id, bias, contrast, invert, pointer to color cells, number of color cells. The output of this command is input for the frame colormap command.
    Example: colorbar get colormap

    get height

    Returns current colorbar height.
    Example: colorbar get height

    get id

    Returns current colormap id.
    Example: colorbar get id

    get invert

    Returns true if current colormap is inverted.
    Example: colorbar get invert

    get name

    Returns colormap name.
    Syntax:
               get name               Return current colormap name
               get name integer  Return colormap id name
    Example: colorbar get name
             colorbar get name 5

    get file name

    Returns current colormap file name.
    Example: colorbar get file name

    get width

    Return current colorbar width
    Example: colorbar get width

    hide

    Hide the colorbar if visible. No effect otherwise.
    Example: colorbar hide

    invert

    Invert the current colormap.
    Syntax:  invert [true | false | yes | no | on | off | 1 | 0]
    Example: colorbar invert yes

    itt

    Use a RTD ITT colormap
    Syntax:
               itt name     use itt name
               itt integer   use itt id
    Example: colorbar itt foo.itt
             colorbar itt 4

    list

    Return list of loaded colormaps.
    Syntax:
               list                    Return list of colormap names
                list  id               Return list of colormap ids
               list name                Return list of colormap names
               list itt                       Return list of itt colormap names
               list itt id                   Return list of itt colormap ids
               list itt name            Return list of itt colormap names
    Example: colorbar list name
             colorbar list id

    load

    Load new colormap.
    Syntax:
               load filename              Load SAOimage colormap file
               load filename type      Load colormap of type (lut, lasc, other) file
               load itt filename          Load ITT colormap file
    Example: colorbar load foo.lut

    map

    Set the current colormap.
    Syntax:
               map name     Use colormap name. The name is case insensitive.
               map id            Use colormap id
    Example: colorbar map heat

    reset

    Reset the colorbar.
    Example: colorbar reset

    save

    Save the current colormap to a file.
    Syntax: save filename
    Example: colorbar map heat

    set colormap

    Set the current colormap.
    Syntax:
               set colormap name  numeric numeric integer  Set colormap name, bias, contrast, invert
               set colormap integer numeric numeric integer Set colormap id, bias, contrast, invert
               set colormap window windowname                    Apply colomap name to tk window name
    Example: colorbar set colormap heat 1 .5 0
             colorbar set colormap .simple

    show

    Show the colorbar if previously hidden. No effect otherwise.
    Example: colorbar show

    version

    Return the current colorbar verison.
    Example: colorbar version