You are here

function image_gd_textimage_set_transparency in Textimage 7.3

Set a color to transparent.

Mainly to support .gif files transparency.

Parameters

object $image: An image object.

array $color: The transparent color array red/blue/green for .gif transparency.

File

effects/textimage_text.gd.inc, line 379
GD2 toolkit for image manipulation within Textimage.

Code

function image_gd_textimage_set_transparency(stdClass $image, $color) {
  if ($color) {
    list($r, $g, $b) = array_values(imagecache_actions_hex2rgba($color));
    $transparent = imagecolorallocate($image->resource, $r, $g, $b);
    imagecolortransparent($image->resource, $transparent);
  }
}