Skip to content

incluud/color-contrast-checker

Repository files navigation

Color Contrast Checker

color-contrast-checker

Built with Astro

A powerful color contrast checker that validates accessibility compliance against WCAG 2.2 standards. Test any color combination using hex, named colors, RGB, HSL, or other formats. Instantly see if your colors meet AA (4.5:1 for normal text, 3:1 for large text) or AAA (7:1 for normal text, 4.5:1 for large text) contrast requirements. Generate color palettes using the modern OKLCH color space for perceptually uniform brightness, plus export ready-to-use CSS custom properties and Figma-compatible JSON tokens for your design system.

LIVE DEMO   DOCUMENTATION   Sponsor on Open Collective  

Our mission

Provide developers with accessible, easy-to-use components that make building inclusive web applications simpler and faster, without compromising on customization or performance.

Features

  • WCAG 2.2 Compliance Testing: Real-time validation against AA and AAA standards
  • Triple Category Analysis: Small text, large text, and UI components testing
  • Universal Color Support: Hex, named colors, RGB, HSL, and other CSS color formats
  • Share Color Combinations: Generate shareable URLs for team collaboration
  • Persistent Storage: Color combinations automatically saved to localStorage
  • Swap Colors: One-click color position swapping with accessibility announcements
  • CSS Custom Properties: Export ready-to-use CSS variables with OKLCH color system
  • Figma Integration: Generate Tokens Studio-compatible JSON following W3C standards
  • OKLCH Color Palettes: Perceptually uniform color generation for design systems
  • Cross-Tab Synchronization: Real-time updates across browser windows
  • Pure Astro Architecture: Educational showcase of hand-built reactive systems
  • Screen Reader Accessible: Comprehensive ARIA labels and live region announcements
  • Keyboard Navigation: Full keyboard accessibility including modal interactions
  • Modern CSS: Logical properties, relative color syntax, and CSS custom properties
  • TypeScript Integration: Full type safety with comprehensive error handling
  • Responsive Design: Works seamlessly across all device sizes
  • Dark Mode Support: Automatic system preference detection
  • Educational Value: Demonstrates advanced web development concepts without frameworks

(Accessibility) Features

  • Real-time contrast ratio calculation with visual feedback
  • Pass/fail badge system for intuitive WCAG compliance understanding
  • Screen reader announcements for all color changes and interactions
  • Keyboard-accessible color picker and text input synchronization
  • Focus preservation during Astro view transitions
  • High contrast visual indicators for pass/fail states
  • Accessible modal dialogs with proper focus management
  • Educational approach to teaching accessibility standards

Getting started

Clone this project locally and run any of the following commands in your terminal:

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:4321
npm run build Build your production site to ./dist/
npm run preview Preview your build locally, before deploying

Accessible Astro ecosystem

The Accessible Astro ecosystem is a collection of projects that are designed to help you build accessible web applications. It includes:

Check out our roadmap to see what's coming next!

Contributing

We welcome contributions to improve the Color Contrast Checker! You can help by:

  1. Filing an issue
  2. Submitting a pull request
  3. Starting a discussion
  4. Supporting on Open Collective

Support this project

Your support helps us cover basic costs and continue building accessible solutions for the Astro ecosystem. By becoming a sponsor, you're not just supporting code – you're helping create a more inclusive web for everyone. Every contribution, big or small, helps maintain and improve these accessibility-focused tools.

Sponsor on Open Collective

Together we make a difference

We want to express our heartfelt gratitude to everyone who contributes to making the web more accessible:

  • The Astro team for creating an amazing static site generator and the wonderful Starlight theme
  • Our contributors who dedicate their time and expertise to improve these tools
  • Our sponsors who help make this project sustainable
  • The web community for embracing and promoting web accessibility
  • You, the developer for choosing to make your projects more accessible


Together, we're not just building documentation or components – we're creating a more inclusive and accessible web for everyone. Every contribution, whether it's code, documentation, bug reports, or feedback, helps move us closer to this goal. ✨

Remember: Accessibility is not a feature, it's a fundamental right. Thank you for being part of this journey!

About

WCAG 2.2 color contrast validator with design system integration. Test accessibility compliance, generate OKLCH palettes, export CSS custom properties and Figma-compatible JSON tokens. Build with Astro.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

  •