Accessibility: Minimum contrast ratio for Konsole

A mini demo translated from xterm.js

Peek 2024-01-07 17-48

This is a feature implemented in iterm2 many years ago.

The idea is simple,

  • Keep the background unchanged,
  • increase the illuminance/brightness of the foreground if the contrast is too low

So that the contrast between text and background is always higher than the desired level.

Related https://github.com/KDE/konsole/blob/master/src/terminalDisplay/TerminalPainter.cpp