首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

ImagickPixel::getHSL

(PECL imagick 2.0.0)

ImagickPixel::getHSL — Returns the normalized HSL color of the ImagickPixel object

Description

代码语言:javascript
复制
array ImagickPixel::getHSL ( void )

Returns the normalized HSL color described by the ImagickPixel object, with each of the three values as floating point numbers between 0.0 and 1.0.

Return Values

Returns the HSL value in an array with the keys "hue", "saturation", and "luminosity". Throws ImagickPixelException on failure.

Examples

Example #1 Basic Imagick::getHSL() example

代码语言:javascript
复制
<?php

$color?=?new?ImagickPixel('rgb(90%,?10%,?10%)');

$colorInfo?=?$color->getHSL();

print_r($colorInfo);

?>

The above example will output:

代码语言:javascript
复制
Array
(
    [hue] => 0
    [saturation] => 0.80001220740379
    [luminosity] => 0.50000762951095
)

Notes

Note: Available with ImageMagick library version 6.2.9 and higher.

← ImagickPixel::getColorValueQuantum

ImagickPixel::getIndex →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com