Annotation of embedaddon/php/ext/gd/tests/colorexact.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: imagecolorexact
3: --SKIPIF--
4: <?php
5: if (!function_exists('imagecolorexact')) die("skip gd extension not available\n");
6: ?>
7: --FILE--
8: <?php
9:
10: $im = imagecreatetruecolor(5,5);
11: $c = imagecolorexact($im, 255,0,255);
12: $c2 = imagecolorexactalpha($im, 255,0,255, 100);
13:
14: printf("%X\n", $c);
15: printf("%X\n", $c2);
16:
17: imagedestroy($im);
18:
19: $im = imagecreate(5,5);
20: $c = imagecolorallocate($im, 255,0,255);
21: $c2 = imagecolorallocate($im, 255,200,0);
22: $c3 = imagecolorallocatealpha($im, 255,200,0,100);
23:
24: echo imagecolorexact($im, 255,0,255) . "\n";
25: echo imagecolorexact($im, 255,200,0) . "\n";
26: echo imagecolorexactalpha($im, 255,200,0,100) . "\n";
27:
28:
29: // unallocated index
30: echo imagecolorexact($im, 12,12,12) . "\n";
31:
32: imagedestroy($im);
33: ?>
34: --EXPECTF--
35: FF00FF
36: 64FF00FF
37: 0
38: 1
39: 2
40: -1
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>