imagecolorexact

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

imagecolorexact取得指定顏色的索引值

說(shuō)明

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

返回圖像調(diào)色板中指定顏色的索引值。

如果顏色不在圖像的調(diào)色板中,返回 -1。

如果從文件創(chuàng)建了圖像,只有圖像中使用了的顏色會(huì)被辨析。僅出現(xiàn)在調(diào)色板中的顏色不會(huì)被辨析。

參見 imagecolorclosest()