1--TEST--
2Casting color and opacity to pixel
3--SKIPIF--
4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
5--FILE--
6<?php
7print "--- Testing casts\n";
8
9try {
10	$im = new Imagick();
11	$im->newImage(100, 100, "red");
12	$im->tintImage("red", "gray(50%)");
13	echo "Casting color and opacity succeeded\n";
14} catch (Exception $e) {
15	echo "Casting color and opacity failed: " , $e->getMessage() . PHP_EOL;
16}
17
18try {
19	$im = new Imagick();
20	$pixel = new ImagickPixel("red");
21	$strengthPixel = new ImagickPixel("gray");
22	$im->newImage(100, 100, $pixel);
23	$im->tintImage($pixel, $strengthPixel);
24	echo "Setting color and opacity without cast succeeded\n";
25} catch (Exception $e) {
26	echo "Setting color and opacity without cast failed: " , $e->getMessage() . PHP_EOL;
27}
28
29?>
30--EXPECTF--
31--- Testing casts
32Casting color and opacity succeeded
33Setting color and opacity without cast succeeded