PHP code example of owen-jones / color-kit
1. Go to this page and download the library: Download owen-jones/color-kit 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/ */
owen-jones / color-kit example snippets
use OwenJones\ColorKit\ColorKit;
$baseColor = '#3498db';
$triad = ColorKit::getColorTriad($baseColor);
print_r($triad);
// ['#3498db', '#db3434', '#34db34']
use OwenJones\ColorKit\ColorKit;
$color1 = '#3498db';
$color2 = '#ffffff';
$isAccessible = ColorKit::isContrastAccessible($color1, $color2);
echo $isAccessible ? 'Accessible' : 'Not Accessible';