← All docs

imagecolorexact()

Returns the palette index of an exact color, or -1.

imagecolorexact()

function imagecolorexact(mixed $image, int $red, int $green, int $blue): int

Returns the palette index of an exact color, or -1.

Parameters:

  • $image (mixed)
  • $red (int)
  • $green (int)
  • $blue (int)

Returns: int

Availability

  • Compiled (AOT): supported through the compiler-injected image prelude.
  • eval() (magician interpreter): not available inside eval’d code.

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

For how imagecolorexact is implemented in the compiler, see the internals page.