(PHP 4, PHP 5, PHP 7)
imagecolorsforindex — ȡ��ij��������ɫ
$image
, int $index
) : array����������һ������ red��green��blue �� alpha �ļ����Ĺ������飬������ָ����ɫ��������Ӧ��ֵ��
Example #1 imagecolorsforindex() ����
<?php
// ��һ��ͼ��
$im = imagecreatefrompng('nexen.png');
// ȡ��һ�����ɫ
$start_x = 40;
$start_y = 50;
$color_index = imagecolorat($im, $start_x, $start_y);
// ʹ��ɶ�
$color_tran = imagecolorsforindex($im, $color_index);
// ��ʾ����ɫ��ֵ
echo '<pre>';
print_r($color_tran);
echo '</pre>';
?>
�����������
Array
(
[red] => 226
[green] => 222
[blue] => 252
[alpha] => 0
)
�μ� imagecolorat() �� imagecolorexact()��