Terminal WCAG color utility built with Rust, ratatui, and crossterm.
- Foreground/background color input in
HEX,RGB/RGBA, andHSL - Live conversion panel (
hex,rgb,hsl) - WCAG AA contrast evaluation for current size/weight
- APCA (Advanced Perceptual Contrast Algorithm) evaluation alongside WCAG
- TUI preview with color + bold styling
- Browser preview with real CSS pixel font size (now includes WCAG and APCA info)
- Palette theme builder for Primary/Secondary/Tertiary brand colors with WCAG-gated
_palette.scssoutput, scrollable generated output, and visible scrollbar - Bottom-right toast notifications that auto-close after 5 seconds
cargo runcargo build --release
./target/release/dd_wcagThe app loads theme files in this order:
./dd_wcag_theme.yml~/.config/ldnddev/dd_wcag_theme.yml- Built-in defaults
Theme files must include version: 1; unsupported or missing versions fall back to built-in defaults with a warning.
Install from current checkout:
./install.shInstall by cloning a repo:
./install.sh --repo https://github.com/your-org/dd_wcag.git --branch mainUninstall:
./install.sh -uninstallThe installer:
- Builds
dd_wcagin release mode - Installs binary to
~/.local/bin/dd_wcag(default) - Installs default theme to
~/.config/ldnddev/dd_wcag_theme.ymlif missing - Uninstall removes the installed binary and
dd_wcag_theme.yml, then removes~/.config/ldnddevonly if it is empty
Tab/Shift+Tab: cycle focus and auto-apply FG/BG/PreviewText inputEnter: insert newline when focus isPreviewTextLeft/Right: move cursor in active input fieldCtrl+Up/Ctrl+Down: increase/decrease font size (6..=120)Ctrl+B: toggle boldG: generate palette when focused on the Palette tabUp/Down: select Palette inputs before generation, scroll generated output after generationFthenG: apply selected Palette color to foreground previewBthenG: apply selected Palette color to background previewCtrl+S: save generated palette to./_palette.scssCtrl+C: copy generated palette values to the system clipboard when availableF1: open keybindings popupF2: open theme debug popupCtrl+O: open web preview (/tmp/dd_wcag_preview.html)Esc: cancel active Palette edit/apply flow or quitCtrl+Q: quit
Non-interactive status and error messages appear as bottom-right toasts and close automatically after 5 seconds.
- Required base colors:
Primary,Secondary, andTertiary - Optional base color:
Support - Text colors are fixed and are not changed by palette generation
- Press
Gto generate the palette and WCAG compliance checks - Generated variables and compliance checks appear in a scrollable detail panel
- A visible scrollbar appears when the generated detail panel has overflow content
Ctrl+Swrites the generated palette to./_palette.scssCtrl+Ccopies the generated palette values when a system clipboard command is available
- Valid color parse and conversion updates:
- Enter valid
HEX,RGB/RGBA, andHSLfor FG/BG. - Verify Conversions tab updates correctly after tabbing out.
- Enter valid
- Invalid color handling:
- Enter invalid
HEX(e.g.#12zz34) and confirm error says HEX. - Confirm the error appears as a bottom-right toast and auto-closes.
- Enter invalid
- Focus/apply flow:
- Cycle
FG -> BG -> PreviewTextusingTab, and reverse withShift+Tab. - Confirm FG/BG drafts persist independently.
- Cycle
- Preview text editing:
- Focus
PreviewText, type text, useEnterfor newline. - Use
Left/Rightand insert in the middle of text.
- Focus
- Font size and weight:
- In Contrast/Preview tabs, use
Ctrl+Up/Downand verify size changes. - Toggle
Ctrl+Band verify bold state changes.
- In Contrast/Preview tabs, use
- Contrast checks:
- Switch to Contrast tab and verify WCAG ratio, pass/fail, and quick reference table.
- Verify APCA Lc value, pass/fail, and quick reference table update with color/size/bold changes.
- Test high/low contrast cases to see differences between WCAG and APCA.
- Web preview sync:
- Press
Ctrl+Oto open/tmp/dd_wcag_preview.html. - Confirm FG/BG/PreviewText/size/bold changes reflect in browser preview.
- Verify WCAG and APCA info is displayed in the meta section.
- Press
- Palette builder:
- Tab to
Palette, edit Primary/Secondary/Tertiary/Support withEnter. - Press
Gand confirm the generated summary has no blocking failures. - Confirm generated variables and compliance checks can be scrolled with
Up/Down. - Confirm the scrollbar appears when the generated panel overflows.
- Press
FthenGand confirm the selected color becomes the foreground. - Press
BthenGand confirm the selected color becomes the background. - Press
Ctrl+Sand confirm_palette.scssis written. - Press
Ctrl+Cand confirm the generated SCSS is copied when a clipboard command is available.
- Tab to
- Terminal rendering cannot change real per-widget font size.
- For true font-size rendering, use the browser preview opened by
Ctrl+O. - APCA provides more accurate contrast for modern displays, often stricter than WCAG for small text.