Function __global->_rgb_from_hsv_contrast
Definitions
sources/themewizard.php
- Helper for calculating an RGB colour with the specified contrast ratio.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $h | float | No | No | required parameter | N/A | N/A | Hue |
| $s | float | No | No | required parameter | N/A | N/A | Saturation |
| $v | float | No | No | required parameter | N/A | N/A | Value |
| $original_luminance | float | No | No | required parameter | N/A | N/A | The luminance of the colour being contrasted |
| $ratio | float | No | No | required parameter | N/A | N/A | The required contrast ratio of the returned RGB colour compared to the provided HSV |
Returns
- RGB colour (null: could not find a colour with the provided contrast ratio)
- Type: ?string
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Helper for calculating an RGB colour with the specified contrast ratio.
*
* @param float $h Hue
* @param float $s Saturation
* @param float $v Value
* @param float $original_luminance The luminance of the colour being contrasted
* @param float $ratio The required contrast ratio of the returned RGB colour compared to the provided HSV
* @return ?string RGB colour (null: could not find a colour with the provided contrast ratio)
*/
function _rgb_from_hsv_contrast(float $h, float $s, float $v, float $original_luminance, float $ratio) : ?string
* Helper for calculating an RGB colour with the specified contrast ratio.
*
* @param float $h Hue
* @param float $s Saturation
* @param float $v Value
* @param float $original_luminance The luminance of the colour being contrasted
* @param float $ratio The required contrast ratio of the returned RGB colour compared to the provided HSV
* @return ?string RGB colour (null: could not find a colour with the provided contrast ratio)
*/
function _rgb_from_hsv_contrast(float $h, float $s, float $v, float $original_luminance, float $ratio) : ?string

