Function __global->contrast_ratio

Definitions

sources/themewizard.php

  • Calculate the contrast ratio between two luminances.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: float

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$a float No No required parameter N/A N/A The first luminance
$b float No No required parameter N/A N/A The second luminance

Returns

  • The contrast ratio as return_value:1
  • Type: float
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Calculate the contrast ratio between two luminances.
 *
 * @param  float $a The first luminance
 * @param  float $b The second luminance
 * @return float The contrast ratio as return_value:1
 */

function contrast_ratio(float $a, float $b) : float