Image_Text::setColor() – Set a color


require_once 'ImageText.php';

bool Image_Text::setColor ( mixed $color , mixed $id = 0 )


This method is used to set a color at a specific color ID inside the color cycle.

The following colors syntaxes are understood by this method:

  • "#ffff00" hexadecimal format (HTML style), with and without #.

  • "#08ffff00" hexadecimal format (HTML style) with alpha channel (08), with and without #.

  • array with 'r','g','b' and (optionally) 'a' keys, using int values.


mixed $color

Color value.

mixed $id

ID (in the color array) to set color to.

Return value

returns True on success, otherwise PEAR::Error.


throws no exceptions thrown


This function can not be called statically.

Set options (Previous) Set the color-set (Next)
Last updated: Mon, 23 Apr 2018 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.