PHP code example of dbeurive / color

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

    

dbeurive / color example snippets


    use dbeurive\Color\Picker;

    print 'HTML code for the color "Absolute Zero": ' . Picker::absoluteZero() . "\n";
    print 'HTML code for the color "Aero Blue": ' . Picker::aeroBlue() . "\n";

    print 'GraphViz code for the color "Absolute Zero": ' . Picker::absoluteZero('graphviz') . "\n";
    print 'GraphViz code for the color "Aero Blue": ' . Picker::aeroBlue('graphviz') . "\n";

    Picker::setDefaultOutputFormat('rgb');

    print 'RGB triplet for the color "Absolute Zero": ' .  print_r(Picker::absoluteZero(), true) . "\n";
    print 'RGB triplet for the color "Aero Blue": ' . print_r(Picker::aeroBlue(), true) . "\n";

    Picker::setDefaultOutputFormat('hsl');

    print 'HSL triplet for the color "Absolute Zero": ' .  print_r(Picker::absoluteZero(), true) . "\n";
    print 'HSL triplet for the color "Aero Blue": ' . print_r(Picker::aeroBlue(), true) . "\n";

    Picker::setDefaultOutputFormat('hsv');

    print 'HSV triplet for the color "Absolute Zero": ' .  print_r(Picker::absoluteZero(), true) . "\n";
    print 'HSV triplet for the color "Aero Blue": ' . print_r(Picker::aeroBlue(), true) . "\n";