Function __global->fix_colour

Definitions

sources/themewizard.php

  • Make sure a colour component fits within the necessary range (0<=x<256).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$x mixed No No required parameter N/A N/A Colour component (float or integer)
$hue boolean No No False N/A N/A Whether this is hue (meaning it cycles around)

Returns

  • Constrained colour component
  • Type: integer
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Make sure a colour component fits within the necessary range (0<=x<256).
 *
 * @param  mixed $x Colour component (float or integer)
 * @param  boolean $hue Whether this is hue (meaning it cycles around)
 * @return integer Constrained colour component
 */

function fix_colour($x, bool $hue = false) : int