HEX
Server: Apache/2.4.65 (Unix) OpenSSL/1.1.1k
System: Linux server-manager.elshandawiily.com 4.18.0-553.87.1.el8_10.x86_64 #1 SMP Mon Dec 1 05:11:16 EST 2025 x86_64
User: elshanda (1002)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //usr/local/src/imagick/tests/269_ImagickPixel_setColorFromPixel_basic.phpt
--TEST--
Test ImagickPixel, setColor
--SKIPIF--
<?php
require_once(dirname(__FILE__) . '/skipif.inc');
checkClassMethods('ImagickPixel', array('setColorFromPixel'));
?>
--FILE--
<?php


$backgroundColor = new \ImagickPixel('green');

$red = new \ImagickPixel('red');

$backgroundColor->setColorFromPixel($red);

$expected = array(
  "r" => 255,
  "g" => 0,
  "b" => 0,
  "a" => 1
);

$actualColor = $backgroundColor->getColor();

if ($actualColor != $expected) {
	echo "Not as expected :\n";
	var_dump($actualColor);
}


echo "Ok";
?>
--EXPECTF--
Ok