TermBuf::Color
Stability: stable — changes only in a major release.
A foreground, background, or underline colour.
Colours are stored exactly as the application supplied them. Reducing a 24 bit colour to the 256 colour palette, or that palette to the sixteen system colours, happens at encode time against the terminal's capability mask — so raising the mask and repainting yields better colour with no information lost along the way.
Constants
The eight basic system colours, by palette index.
Their bright counterparts, which need Capability::BrightColors to come
out bright rather than dim.
The six levels each channel takes in the 6x6x6 colour cube.
The sixteen system colours as xterm renders them. Terminals are free to
remap these, which is exactly why an Indexed colour is never rewritten
to Rgb: only the reverse direction is a downgrade.
Constructors
A colour from the 256 colour palette. Indices 0 through 7 are the basic colours, 8 through 15 their bright counterparts, 16 through 231 the colour cube, and 232 through 255 the grey ramp.
Instance methods
Red channel, meaningful only for an Rgb colour. channels resolves a
palette index instead.
Whether this is one of the eight bright system colours, which some
terminals reach through the 90-97 and 100-107 codes rather than
the palette.
The colour's red, green, and blue channels. An Indexed colour resolves
through the standard xterm palette; a Default colour has no channels of
its own and reports black.
Red channel, meaningful only for an Rgb colour. channels resolves a
palette index instead.
Red channel, meaningful only for an Rgb colour. channels resolves a
palette index instead.
The nearest of the sixteen system colours. A Default colour passes
through unchanged; everything else resolves through its channels.
The nearest colour in the 256 colour palette. Default and Indexed
colours are already expressible and pass through unchanged.