ImagickPixel::getColorAsString

(PECL imagick 2.1.0)
Returns the color as a string
string ImagickPixel::getColorAsString ( void )

Returns the color of the ImagickPixel object as a string.

Returns:

Returns the color of the ImagickPixel object as a string.

Notes:
Alpha not returned

This function does not return the alpha value of the color in the string.

Examples:
Basic Imagick::getColorAsString() usage
<?php

//Create an ImagickPixel with the predefined color 'brown'
$color = new ImagickPixel('brown');

$color->setColorValue(Imagick::COLOR_ALPHA, 64 / 256.0);

$colorInfo = $color->getColorAsString();

print_r($colorInfo);
?>

The above example will output:

rgb(165,42,42)
doc_php
2016-02-24 16:01:51
Comments
Leave a Comment

Please login to continue.