Example #1
0
 public static function ImageColorize(&$image, $hex)
 {
     $rgb = ColorUtils::hex2rgb($hex);
     if (function_exists('imagefilter')) {
         imagefilter($image, IMG_FILTER_COLORIZE, $rgb['r'], $rgb['g'], $rgb['b']);
     }
 }
Example #2
0
 /**
  * Converts a hex color (0x######) to it's hsl equivalent
  * @param int $hex
  * @return array (h,s,l)
  */
 public static function hex2hsl($hex)
 {
     return ColorUtils::rgb2hsl(ColorUtils::hex2rgb($hex));
 }