v0.18.0: HuxWCAG Utilities & Code Refactoring
π Release v0.18.0
β¨ Added
- HuxWCAG Utility: New shared WCAG contrast calculation utilities (
HuxWCAGclass)- Centralized WCAG 2.1 compliant contrast ratio calculations
- Public API for developers to use in custom components
- Proper gamma correction and ITU-R BT.709 coefficients for accurate calculations
- Exported from main library for easy access
- Helper methods:
getContrastingTextColor(),calculateContrastRatio(),getRelativeLuminance(),meetsContrastAA()
π§ Enhanced
- Code Quality: Major refactoring of WCAG contrast calculations across all components
- Extracted duplicate WCAG code (~150+ lines) into shared
HuxWCAGutility class - Standardized all components to use proper WCAG 2.1 calculation (replaced
computeLuminance()with manual WCAG formula) - Updated components: HuxButton, HuxDropdown, HuxPagination, HuxToggle, HuxCheckbox, HuxBadge
- Improved maintainability with single source of truth for contrast calculations
- Enhanced consistency and accuracy of accessibility calculations
- No breaking changes - all changes are internal improvements
- Extracted duplicate WCAG code (~150+ lines) into shared
π¦ Installation: flutter pub add hux
π Documentation: https://docs.thehuxdesign.com
π Full Changelog: See CHANGELOG.md