davidvandertuijn/color-contrast

Color Contrast

Maintainers

Package info

github.com/davidvandertuijn/color-contrast

pkg:composer/davidvandertuijn/color-contrast

Statistics

Installs: 458

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.1 2022-03-06 22:03 UTC

This package is auto-updated.

Last update: 2026-03-01 00:28:07 UTC


README

Total Downloads Latest Stable Version License

Color Contrast

The Luminosity Contrast Algorithm is a powerful tool designed to assess the contrast of a color value relative to pure white (#FFFFFF) and pure black (#000000). This algorithm is essential for ensuring that text and visual elements are easily readable against their backgrounds, thereby enhancing accessibility and user experience.

"Buy Me A Coffee"

Install

composer require davidvandertuijn/color-contrast

Usage

use Davidvandertuijn\ColorContrast;

Parse

ColorContrast::parse('#FF0000'); // #FFFFFF (red to white)
ColorContrast::parse('#FFFF00'); // #000000 (yellow to black)