Previous: , Up: Guile API   [Contents][Index]


23.4.3.26 Colors In Guile

You can assign instance of <gdb:color> to the value of a <gdb:parameter> object created with PARAM_COLOR.

<gdb:color> may refer to an index from color palette or contain components of a color from some colorspace.

Scheme Procedure: make-color [value [#:color-space color-space]]

value is an integer index of a color in palette, tuple with color components or a string. String can be a hex RGB triplet in ‘#RRGGBB’ format or one of the following color names: ‘none’ (meaning the terminal’s default color), ‘black’, ‘red’, ‘green’, ‘yellow’, ‘blue’, ‘magenta’, ‘cyan’, or ‘white’.

color-space should be one of the ‘COLORSPACE_’ constants. This argument tells GDB which color space value belongs.

Scheme Procedure: color? object

Return #t if object is a <gdb:color> object. Otherwise return #f.

Scheme Procedure: color-none? color

Return #t if color is terminal’s default. Otherwise return #f.

Scheme Procedure: color-indexed? color

Return #t if color is indexed, i.e. belongs to some palette. Otherwise return #f.

Scheme Procedure: color-direct? color

Return #t if color is direct in the sense of ISO/IEC 8613-6. Otherwise return #f.

Scheme Procedure: color-string color

Return the textual representation of a <gdb:color> object.

Scheme Procedure: color-colorspace color

Return the color space of a <gdb:color> object.

Scheme Procedure: color-index color

Return index of the color of a <gdb:color> object in a palette.

Scheme Procedure: color-components color

Return components of the direct <gdb:color> object.

Scheme Procedure: color-escape-sequence color is_foreground

Return string to change terminal’s color to this.

If is_foreground is #t, then the returned sequence will change foreground color. Otherwise, the returned sequence will change background color.

When color is initialized, its color space must be specified. The available color spaces are represented by constants defined in the gdb module:

COLORSPACE_MONOCHROME

Palette with only terminal’s default color.

COLORSPACE_ANSI_8COLOR

Palette with eight standard colors of ISO/IEC 6429 "black", "red", "green", etc.

COLORSPACE_AIXTERM_16COLOR

Palette with 16 colors. First eight are standard colors of ISO/IEC 6429 "black", "red", "green", etc. Next eight are their bright version.

COLORSPACE_XTERM_256COLOR

Palette with 256 colors. First 16 are from COLORSPACE_AIXTERM_16COLOR. Next 216 colors are 6x6x6 RGB cube. And last 24 colors form grayscale ramp.

COLORSPACE_RGB_24BIT

Direct 24-bit RGB colors.


Previous: , Up: Guile API   [Contents][Index]