Skip to content

Add protanopia- and tritanopia-safe Vim variants - #11

Merged
bruschill merged 1 commit into
mainfrom
colorblind-safe-variants
Jul 12, 2026
Merged

Add protanopia- and tritanopia-safe Vim variants#11
bruschill merged 1 commit into
mainfrom
colorblind-safe-variants

Conversation

@bruschill

Copy link
Copy Markdown
Owner

What

Adds two colorblind-safe Vim colorschemes derived from the canonical vim/colors/madeofcode.vim, plus README documentation.

  • vim/colors/madeofcode-protan.vim — protanopia (red-blindness). The signature red keywords render as a near-invisible gray to protanopes, so they move to bright amber, and syntax roles are re-encoded onto the blue↔yellow axis + lightness (the channels protanopes retain).
  • vim/colors/madeofcode-tritan.vim — tritanopia (blue-blindness). Red, green, and magenta survive this deficiency and are kept; the blue family (which otherwise collapses into a single teal) is rotated onto pink / orange / teal.

How

Both variants are generated by remapping the source palette hex-for-hex, so every highlight group stays consistent with the canonical scheme. The remaps were chosen and re-verified against Machado 2009 dichromat simulation to confirm previously-colliding syntax roles now separate. ctermfg codes were recomputed to the nearest xterm-256 color for each remapped hue so the variants also render correctly in 256-color terminals.

Docs

  • Vim section gains a Colorblind-safe variants subsection with install notes.
  • New Accessibility subsection in the color breakdown with before/after swatch tables for each variant.
  • Contents updated with links to both.

Notes / caveats

With only blue↔yellow + lightness available, protanopia genuinely can't give all 9 roles unique hues — String/Identifier lean on lightness and Comment keeps its italic. The tightest remaining tritan pair is Constant (pink) vs Decorator (orange). Documented honestly rather than over-claimed.

Derive two colorblind-safe schemes from the canonical vim colorscheme:

- madeofcode-protan.vim (red-blindness): red keywords -> bright amber
  (red renders as a near-invisible gray to protanopes); roles re-encoded
  onto the blue<->yellow axis + lightness.
- madeofcode-tritan.vim (blue-blindness): red/green/magenta kept (they
  survive); the blue family rotated onto pink/orange/teal so it no longer
  collapses into one teal.

Both are generated by remapping the source palette and re-verified against
Machado 2009 dichromat simulation. 256-color cterm codes recomputed to the
nearest xterm-256 for each remapped hue. README documents both under Vim
and a new Accessibility color-breakdown section, with Contents links.
@bruschill
bruschill merged commit cdc77c0 into main Jul 12, 2026
@bruschill
bruschill deleted the colorblind-safe-variants branch July 12, 2026 22:10
bruschill added a commit that referenced this pull request Jul 12, 2026
Extend the colorblind-safe Vim variants (PR #11) to every other port:
alacritty, eclipse, ghostty, helix, iterm2, jetbrains (icls + theme.json),
kitty, pi, sublime (color-scheme + tmTheme), vscode, web (highlight.js,
prism, shiki), windows-terminal, xcode, and zed.

Each ships a madeofcode-protan.* and madeofcode-tritan.* beside its base
theme, generated by applying the same source-palette remap used for Vim so
the colorblind-safe choices stay consistent across editors, terminals, and
tools. Terminal ANSI palettes and editor status-message backgrounds
(error/warning/info/added) are remapped to follow their hue's treatment.

Format-aware generation: hex string formats remapped directly; iTerm2 and
Xcode plists converted via their float components; plists re-validated with
plutil and all JSON re-parsed. VS Code variants registered in package.json
so they appear in the theme picker.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant