imagecolorexact

(PHP 4, PHP 5, PHP 7, PHP 8)

imagecolorexact取得指定颜色的索引值

说明

imagecolorexact(
    resource $image,
    int $red,
    int $green,
    int $blue
): int

返回图像调色板中指定颜色的索引值。

如果颜色不在图像的调色板中,返回 -1。

如果从文件创建了图像,只有图像中使用了的颜色会被辨析。仅出现在调色板中的颜色不会被辨析。

参见 imagecolorclosest()

7i24.Com