PHP code example of dewsign / color

1. Go to this page and download the library: Download dewsign/color 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/ */

    

dewsign / color example snippets




use Dewsign\Color;

$rgbColor = Color::fromHEX('#1E90FF')->toRGB();
// [30, 144, 255]



use Dewsign\Color;

$rgbColor = Color::fromHEX('#1E90FF')->toRGBString();
// rgb(30, 144, 255)



use Dewsign\Color;

$primaryColor = '#1E90FF';

$secondaryColor = Color::fromHEX('#1E90FF')->darken(10)->toHEX();
// #2A8FF4




use Dewsign\Color;

$dullColor = '#C44';

$exitingColor = Color::fromHEX('#C44')->saturate(10)->toHEX();
// #D33C3C