SetTransparentColor

SetTransparentColor — Designate one color to be transparent

Synopsis

$plot->SetTransparentColor($color)
    

Description

SetTransparentColor designates one color in the image to be transparent. The designated color will not be visible (assuming the image is viewed with a program which supports transparency) - instead, everything drawn in that color will be transparent. By default, no color is transparent.

Parameters

$color

Name of the color in the current color map (see SetRGBArray) which should become transparent.

Notes

This will only work if both the selected image file format (see SetFileFormat) and the user's browser or viewer support transparency. GIF format supports transparency. PNG format also supports transparency, but viewer support is more limited.

Example

To set the plot image background to be transparent, pick a color (here 'yellow') that won't be used anywhere else on the image, and use code like this:

$plot->SetBackgroundColor('yellow');
$plot->SetTransparentColor('yellow');