Solaar/lib/solaar/ui/perkey
Ken Sanislo c3382b0ba6 PerKey canvas: symmetric hash stripes for unset cells
The "no change" hash overlay used a single black-or-white stripe
color picked by the base luminance, so the perceived average of an
unset cell was uniformly biased toward black or white instead of
sitting on the actual base color. That made dark base cells look
darker than they really are on the keyboard, and light ones lighter.

Draw two interleaved stripe sets at base ± offset (per channel),
spaced by half-period so the dark and light stripes alternate
evenly across the cell. Equal coverage of the two stripe colors
keeps the perceived average at base.

When a channel is too close to 0 or 1 to fit the full offset
(±0.22), halve the offset on the constrained side. The cell's
average then drifts at the limits but stays centered on base
everywhere else — verified visually across mid-tones, primaries,
and near-black/white bases.

The "no zone base color known" path keeps the previous neutral-grey
look unchanged; the average-preservation property only applies when
there is a base color to preserve.
2026-05-12 12:51:36 -04:00
..
layouts Add regional keyboard layouts (ISO_QWERTY, QWERTZ, AZERTY, JIS) and fix copyright 2026-05-10 17:52:55 -04:00
__init__.py Add regional keyboard layouts (ISO_QWERTY, QWERTZ, AZERTY, JIS) and fix copyright 2026-05-10 17:52:55 -04:00
_icons.py PerKey palette: replace hashed unset swatch with palette-off icon 2026-05-12 12:51:36 -04:00
binding.py Add regional keyboard layouts (ISO_QWERTY, QWERTZ, AZERTY, JIS) and fix copyright 2026-05-10 17:52:55 -04:00
canvas.py PerKey canvas: symmetric hash stripes for unset cells 2026-05-12 12:51:36 -04:00
control.py Add regional keyboard layouts (ISO_QWERTY, QWERTZ, AZERTY, JIS) and fix copyright 2026-05-10 17:52:55 -04:00
dialog.py Add regional keyboard layouts (ISO_QWERTY, QWERTZ, AZERTY, JIS) and fix copyright 2026-05-10 17:52:55 -04:00
editor.py PerKey palette: replace hashed unset swatch with palette-off icon 2026-05-12 12:51:36 -04:00
layout.py Add regional keyboard layouts (ISO_QWERTY, QWERTZ, AZERTY, JIS) and fix copyright 2026-05-10 17:52:55 -04:00
palette.py PerKey palette: replace hashed unset swatch with palette-off icon 2026-05-12 12:51:36 -04:00
protocol.py Add regional keyboard layouts (ISO_QWERTY, QWERTZ, AZERTY, JIS) and fix copyright 2026-05-10 17:52:55 -04:00
tools.py Add regional keyboard layouts (ISO_QWERTY, QWERTZ, AZERTY, JIS) and fix copyright 2026-05-10 17:52:55 -04:00