You are here

function watermark::_get_image_color in ImageCache Actions 5.2

Same name and namespace in other branches
  1. 8 watermark.inc \watermark::_get_image_color()
  2. 5.3 watermark.inc \watermark::_get_image_color()
  3. 6.2 watermark.inc \watermark::_get_image_color()
  4. 6 watermark.inc \watermark::_get_image_color()
  5. 7 watermark.inc \watermark::_get_image_color()
1 call to watermark::_get_image_color()
watermark::create_watermark in ./watermark.inc

File

./watermark.inc, line 76
routine for image layering

Class

watermark

Code

function _get_image_color($im, $r, $g, $b, $alpha) {
  $c = imagecolorexactalpha($im, $r, $g, $b, $alpha);
  if ($c != -1) {
    return $c;
  }
  $c = imagecolorallocate($im, $r, $g, $b, $alpha);
  if ($c != -1) {
    return $c;
  }
  return imagecolorclosest($im, $r, $g, $b, $alpha);
}