PHP code example of ortic / color-converter

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

    

ortic / color-converter example snippets


$color = Color::fromString('#ff0000');

$color = Color::fromString('red');
$color = Color::fromString('rgb(255, 0, 0)');
$color = Color::fromString('hsl(0, 100%, 50%)');

echo $color->toHex();