1. Go to this page and download the library: Download breadthe/php-contrast library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
breadthe / php-contrast example snippets
use Breadthe\PhpContrast\HexColor; // factory
use Breadthe\PhpContrast\HexColorPair; // hex pair utilities
use Breadthe\PhpContrast\TailwindColor; // Tailwind color pair utilities
// Minimum 3:1 contrast ratio
HexColorPair::sibling('000000')->hex; // '#ffffff'
// Minimum specified contrast ratio (no less than 3:1)
HexColorPair::minContrast(4.5)->getSibling('000000')->hex; // '#ffffff'