Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 16 days 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.

Awesome Lists containing this project

README

        

# Contrast Accessibility
[![Build](https://github.com/BenMMcLean/contrast-accessibility/actions/workflows/build.yml/badge.svg)](https://github.com/BenMMcLean/contrast-accessibility/actions/workflows/build.yml)
[![Lint](https://github.com/BenMMcLean/contrast-accessibility/actions/workflows/lint.yml/badge.svg)](https://github.com/BenMMcLean/contrast-accessibility/actions/workflows/lint.yml)
[![Test](https://github.com/BenMMcLean/contrast-accessibility/actions/workflows/test.yml/badge.svg)](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
![Stable](https://img.shields.io/github/v/release/BenMMcLean/contrast-accessibility?label=Stable)
![Preview](https://img.shields.io/github/v/release/BenMMcLean/contrast-accessibility?label=Preview&include_prereleases)

```
implementation "cl.emilym:contrast-accessibility:"
```

## Usage
```java
long color1 = 0xFF0000; // Red
long color2 = 0x000000; // Black
System.out.println(ContrastAccessibility.valid(color1, color2)); // True
```