uilint
Automated UI screenshot linter for safe areas, tap targets, contrast, and CVD.
Screenshot-driven UI linter that checks mobile and desktop game HUDs for notch/Dynamic Island cutouts, safe-area violations, small tap targets, WCAG text contrast, text clipping, and color-vision deficiency confusion.
git clone https://github.com/BestRoiMedia/game-senses.gitWhy we built it
HUD regressions—like a button slipping under the iPhone home indicator or red-on-green status text becoming indistinguishable for color-blind players—are easy to miss in quick visual checks. uilint automates these geometric and perceptual checks on any screenshot.
Architecture & how it works
uilint.py detects device and orientation from pixel dimensions (or explicit flags), runs OCR via macOS Vision (compiled Swift helper) or Tesseract, and evaluates optional layout JSON rects or flood-filled button plates. It checks safe insets, minimum 44pt/48dp tap targets, WCAG contrast ratios, overlapping text/tappables, and Machado 2009 protan/deutan/tritan CIEDE2000 color pairs, outputting annotated overlay and CVD simulation PNGs.
Key capabilities
- Detects Dynamic Island, notch, punch-hole cutouts, and home-indicator overlaps
- Flags tap targets under 44pt (iOS) or 48dp (Android) using layout JSON or flood-fill estimation
- Evaluates WCAG contrast ratios on OCR-detected text and flags clipped or overflowing labels
- Simulates protanopia, deuteranopia, and tritanopia (Machado 2009) with CIEDE2000 pair checks
- Produces color-coded overlay PNGs and 4-panel CVD comparison sheets
Usage example
python3 uilint/uilint.py check ./shot.png --device auto --key-colors "#e33,#3c3"
python3 uilint/uilint.py cvd ./shot.png