https://github.com/emilymclean/contrast-accessibility
Provides a utility class for checking contrast accessibility between colors and calculating contrast ratios using the standards defined in WCAG 2.1.
https://github.com/emilymclean/contrast-accessibility
java-library wcag2
Last synced: 9 months ago
JSON representation
Provides a utility class for checking contrast accessibility between colors and calculating contrast ratios using the standards defined in WCAG 2.1.
- Host: GitHub
- URL: https://github.com/emilymclean/contrast-accessibility
- Owner: emilymclean
- License: mit
- Created: 2024-05-03T13:19:52.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-18T00:33:58.000Z (over 1 year ago)
- Last Synced: 2025-04-05T13:44:19.495Z (about 1 year ago)
- Topics: java-library, wcag2
- Language: Java
- Homepage: https://emilym.cl/contrast-accessibility/javadoc
- Size: 294 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Contrast Accessibility
[](https://github.com/BenMMcLean/contrast-accessibility/actions/workflows/build.yml)
[](https://github.com/BenMMcLean/contrast-accessibility/actions/workflows/lint.yml)
[](https://github.com/BenMMcLean/contrast-accessibility/actions/workflows/test.yml)
Provides a utility class for checking contrast accessibility between colors and calculating contrast ratios using the standards defined in WCAG 2.1.
## Installation


```
implementation "cl.emilym:contrast-accessibility:"
```
## Usage
```java
long color1 = 0xFF0000; // Red
long color2 = 0x000000; // Black
System.out.println(ContrastAccessibility.valid(color1, color2)); // True
```