array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'imagickpixel.getcolorasstring.php', 1 => 'ImagickPixel::getColorAsString', 2 => 'Returns the color as a string', ), 'up' => array ( 0 => 'class.imagickpixel.php', 1 => 'ImagickPixel', ), 'prev' => array ( 0 => 'imagickpixel.getcolor.php', 1 => 'ImagickPixel::getColor', ), 'next' => array ( 0 => 'imagickpixel.getcolorcount.php', 1 => 'ImagickPixel::getColorCount', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/imagick/imagickpixel/getcolorasstring.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

ImagickPixel::getColorAsString

(PECL imagick 2 >= 2.1.0, PECL imagick 3)

ImagickPixel::getColorAsStringReturns the color as a string

Beschreibung

public ImagickPixel::getColorAsString(): string

Returns the color of the ImagickPixel object as a string.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Returns the color of the ImagickPixel object as a string.

Beispiele

Beispiel #1 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);
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

rgb(165,42,42)

Anmerkungen

Hinweis: Alpha not returned

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