Skip to main content

Module palette

Module palette 

Source
Expand description

Linux-console palette sequences.

§Category

This module encodes the compact OSC P/R palette controls used by the Linux text console: setting one of 16 palette entries and resetting all entries.

§OSC framing

Palette writes use ESC ] P n rrggbb BEL, where n is a single hexadecimal palette index. Reset is the fixed byte string ESC ] R BEL.

§Mode interaction

These sequences do not depend on ANSI or DEC modes and are specific to terminals that implement this palette protocol.

Constants§

RESET_PALETTE
Reset the Linux-console palette: exact bytes ESC ] R BEL (b"\x1b]R\x07").

Functions§

write_set_palette
Set a 16-color palette entry with ESC ] P <index-hex> <rrggbb> BEL.