ImageSetDrawingColor

Sets the current drawing color for images. All subsequent graphics operations use the specified color.

ImageSetDrawingColor( image, color )

Returns: void

Argument Description
image
any, required

The image on which this operation is performed.

Alias: name, source

color
string, required

Drawing color (The default value is "black"):

  • Hexadecimal value of RGB color. For example, specify the color white as ##FFFFFF or FFFFFF.
  • String value of color (for example, "black", "red", "green").
  • List of three numbers for (R,G,B) values. Each value must be in the range 0-255.

Alias: colour

Examples

myImg = imageNew("",300,200,"rgb","eccc68");
imageSetDrawingColor(myImg,"009432");//All subsequent graphics operations use the specified color.
ImageDrawLine(myImg,0,0,300,200)
ImageDrawText(myImg,"Plant green,",10,90)
ImageDrawText(myImg,"Save world!",180,100)
cfimage(action="writeToBrowser", source=myImg);

See also