Skip to main content

paint_console_color

Function paint_console_color 

fn paint_console_color(
    api: &dyn WindowsApi,
    target: Option<CONSOLE_CHARACTER_ATTRIBUTES>,
    last: &mut Option<CONSOLE_CHARACTER_ATTRIBUTES>,
)
Expand description

Paint target if it differs from last, then update last.

Skipping unchanged repaints avoids an unnecessary LPC roundtrip to conhost and the post-fill InvalidateRect/WM_PAINT.

ยงArguments

  • api - The Windows API implementation to use.
  • target - The color to paint, or None to skip.
  • last - The most recently painted color; updated in-place after a successful repaint.