<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Returns the normalized HSL color of the ImagickPixel object</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="imagickpixel.getcolorvalue.html">ImagickPixel::getColorValue</a></div> <div class="next" style="text-align: right; float: right;"><a href="imagickpixel.ispixelsimilar.html">ImagickPixel::isPixelSimilar</a></div> <div class="up"><a href="class.imagickpixel.html">ImagickPixel</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="imagickpixel.gethsl" class="refentry"> <div class="refnamediv"> <h1 class="refname">ImagickPixel::getHSL</h1> <p class="verinfo">(PECL imagick 2.0.0)</p><p class="refpurpose"><span class="refname">ImagickPixel::getHSL</span> — <span class="dc-title">Returns the normalized HSL color of the ImagickPixel object</span></p> </div> <div class="refsect1 description" id="refsect1-imagickpixel.gethsl-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><strong>ImagickPixel::getHSL</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> 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. </p> </div> <div class="refsect1 returnvalues" id="refsect1-imagickpixel.gethsl-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the HSL value in an array with the keys "hue", "saturation", and "luminosity". Throws ImagickPixelException on failure. </p> </div> <div class="refsect1 examples" id="refsect1-imagickpixel.gethsl-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-3349"> <p><strong>Example #1 Basic <span class="function"><strong>Imagick::getHSL()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /><br />$color </span><span style="color: #007700">= new </span><span style="color: #0000BB">ImagickPixel</span><span style="color: #007700">(</span><span style="color: #DD0000">'rgb(90%, 10%, 10%)'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$colorInfo </span><span style="color: #007700">= </span><span style="color: #0000BB">$color</span><span style="color: #007700">-></span><span style="color: #0000BB">getHSL</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$colorInfo</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> Array ( [hue] => 0 [saturation] => 0.80001220740379 [luminosity] => 0.50000762951095 ) </pre></div> </div> </div> </p> </div> <div class="refsect1 notes" id="refsect1-imagickpixel.gethsl-notes"> <h3 class="title">Notes</h3> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Available with ImageMagick library version 6.2.9 and higher. </p> </p></blockquote> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="imagickpixel.getcolorvalue.html">ImagickPixel::getColorValue</a></div> <div class="next" style="text-align: right; float: right;"><a href="imagickpixel.ispixelsimilar.html">ImagickPixel::isPixelSimilar</a></div> <div class="up"><a href="class.imagickpixel.html">ImagickPixel</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>