WP_Duotone::colord_hsla_to_hsva
Converts an HSLA array to HSVA.
Direct port of colord's hslaToHsva function.
Метод класса: WP_Duotone{}
Хуков нет.
Возвращает
array. The HSVA array.
Использование
$result = WP_Duotone::colord_hsla_to_hsva( $hsla );
- $hsla(массив) (обязательный)
- The HSLA array to convert.
Список изменений
| С версии 6.3.0 | Введена. |
Код WP_Duotone::colord_hsla_to_hsva() WP Duotone::colord hsla to hsva WP 7.1
private static function colord_hsla_to_hsva( $hsla ) {
$h = $hsla['h'];
$s = $hsla['s'];
$l = $hsla['l'];
$a = $hsla['a'];
$s *= ( $l < 50 ? $l : 100 - $l ) / 100;
return array(
'h' => $h,
's' => $s > 0 ? ( ( 2 * $s ) / ( $l + $s ) ) * 100 : 0,
'v' => $l + $s,
'a' => $a,
);
}