davidvandertuijn/color-contrast

1.1 2022-03-06 22:03 UTC

This package is auto-updated.

Last update: 2024-11-29 13:34:15 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)