Commit graph

2 commits

Author SHA1 Message Date
ff7a9f6e49 Improve colour contrast to meet WCAG 2.1 AA
Bring the SVG board and the text-mode faces up to WCAG 2.1 AA contrast.
Two oppositions drove the changes: no single ring colour meets 3:1 on
both a near-white card face and the dark-green felt, and no single
fixed suit/marker colour meets 4.5:1 on both a light and a dark Emacs
theme.  The rings therefore become haloed (bright core plus dark edge,
readable on either ground) and the theme-sensitive faces gain
light/dark variants.  Ratios are computed from the sRGB
relative-luminance formula.

* card-games-svg.el (card-games-svg-card): Draw the cursor highlight
as a haloed ring (dark edge, bright core) so it clears 3:1 on both a
card face and the felt; the old single gold ring was 1.63:1 on a card.
Draw the hint as a haloed dashed ring for the same reason, keeping the
dash pattern so it stays distinct by shape, not colour alone.
(card-games-svg-club-color): #1a8a3c -> #166534; four-colour clubs
were 4.35:1 on the card face, now 7.00:1.
(card-games-svg-hint-color): #27ae60 -> #7cf59a; 2.36:1 -> 4.97:1 on
felt.
(card-games-svg-gap-color): #95a5a6 -> #cbd5e1; 2.65:1 -> 4.57:1 on
felt (empty slots carry meaning in Gaps and Montana).

* card-games-core.el (card-games-red-suit): Add a dark-theme variant
(card-games-hint): Give light/dark variants (#207a3f on light, green3
bold on dark); green3 was 2.16:1 on white, now 5.36:1.
(card-games-gap): Give light/dark variants (#595959 light, #a6a6a6
dark); gray50 failed both themes, now about 7:1 light and 6:1 dark.

The card border and faint panel divider are left unchanged -- the card
face already contrasts the felt at 6.67:1, so card edges read
regardless -- and the SVG board's lack of an accessible name is covered
by the text/UNICODE rendering, the intended accessible alternative.

Assisted-by: Claude:claude-opus-4-8
2026-08-04 09:45:56 -05:00
209ebdc02a card-games: rename cg- prefix to card-games- for MELPA 2026-08-03 23:21:57 -05:00
Renamed from cg-core.el (Browse further)