Skip to main content

set_console_palette

Function set_console_palette 

pub fn set_console_palette(
    api: &dyn WindowsApi,
    palette: &[COLORREF; 16],
) -> bool
Expand description

Installs palette as the console’s 16-entry color table, leaving the rest of the buffer info as it currently is, and forces a repaint.

§Arguments

  • api - The Windows API implementation to use.
  • palette - The 16 RGB entries to install.

§Returns

true if the palette was written, false if reading or writing the buffer info failed so the caller can keep its snapshot and retry the paint.