コード例 #1
0
ファイル: ImageUtils.php プロジェクト: rsids/bright_api
 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']);
     }
 }
コード例 #2
0
ファイル: ColorUtils.php プロジェクト: rsids/bright_api
 /**
  * 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));
 }