Function __global->imagecolorclosest

Definitions

sources_custom/phpstub.php

  • Get the index of the closest color to the specified color.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$image resource No No required parameter N/A N/A The image involved
$red integer No No required parameter N/A N/A Red
$green integer No No required parameter N/A N/A Green
$blue integer No No required parameter N/A N/A Blue

Returns

  • Colour number
  • Type: integer
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get the index of the closest color to the specified color.
 *
 * @param  resource $image The image involved
 * @param  integer $red Red
 * @param  integer $green Green
 * @param  integer $blue Blue
 * @return integer Colour number
 */

function imagecolorclosest($image, int $red, int $green, int $blue) : int