davidvandertuijn / color-contrast
Color Contrast
1.1
2022-03-06 22:03 UTC
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2024-11-29 13:34:15 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)