<?php
if(!extension_loaded('infusion')) {
function bround($n, $b) {
if($b == 0) {
return false;
}
return $n + $b - $n % $b;
}
function limit($num, $max) {
return $num > $max ? $max : $num;
}
function bound($x, $min, $max) {
if ($x < $min) {
return $min;
} else if ($x > $max) {
return $max;
} else {
return $x;
}
}
}
require 'xcolor.php';
$xc = new xColor;
$xc->setType(T_COLOR_HEX, T_COLOR_RGB);
$c1 = $xc->random();
$c2 = $xc->random();
$xc->setType(T_COLOR_RGB, T_COLOR_HEX);
echo $xc->red($c1); // 90FFFF
echo $xc->green($c1); // FF0CFF
echo $xc->blue($c1); // FFFFB8
echo $xc->webround($c2); // 66CC99
// Get the color point on a gradient
$xc->gradientLevel($c1, $c2, 100, rand(0,100));
?>
|