davidvandertuijn / color-contrast
Color Contrast
Installs: 303
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/davidvandertuijn/color-contrast
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2025-09-29 02:33:49 UTC
README
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.
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)