You are here

function image_imagick_coloroverlay in Imagick 7

Implements hook_{toolkit}_{effect}()

File

effects/imagick.coloroverlay.inc, line 30

Code

function image_imagick_coloroverlay(stdClass $image, $data = array()) {
  $color = $data['RGB']['HEX'];
  $color = empty($color) ? 'none' : $color;
  $overlay = new Imagick();
  $overlay
    ->newImage($image->info['width'], $image->info['height'], new ImagickPixel($color));
  return $image->resource
    ->compositeImage($overlay, Imagick::COMPOSITE_DEFAULT, 0, 0);
}