$colorString = 'rgb(90%, 10%, 10%)'; $output = "The result of getHSL for the color '$colorString' is:<br/>"; $color = new \ImagickPixel($colorString); $colorInfo = $color->getHSL(); foreach ($colorInfo as $key => $value) { $output .= "$key : $value <br/>"; } return $output;