Code: Select all
<?php
$color="A3E7EF";
include_once("../color_converter/color_converter.class.php");
$cc=new colorConverter;
$hsl=$cc->HEX2HSL($color);
$h=$hsl[0]/360*100;
exec("convert 1.png -colorspace hsl " .
"-channel r -evaluate set $h% +channel " .
"-channel g -evaluate set $hsl[1]% +channel " .
"a.png");
echo "<img src='1.png' /><img src='a.png' />";
echo "<br>";
exec("convert -size 100x100 gradient:black-none 2.png");
exec("convert 2.png -colorspace hsl " .
"-channel r -evaluate set $h% +channel " .
"-channel g -evaluate set $hsl[1]% +channel " .
"b.png");
echo "<img src='2.png' /><img src='b.png' /> ";
exec("convert -size 100x100 gradient:black-red 3.png");
exec("convert 3.png -colorspace hsl " .
"-channel r -evaluate set $h% +channel " .
"-channel g -evaluate set $hsl[1]% +channel " .
"c.png");
echo "<img src='3.png' /><img src='c.png' />";
?>