grayscaleValue() public static method

Calculates the grayscale value of a color.
public static grayscaleValue ( integer $r, integer $g, integer $b ) : integer
$r integer A red value.
$g integer A green value.
$b integer A blue value.
return integer The grayscale value of the color.
Example #1
0
 /**
  * Turns an RGB value into grayscale.
  *
  * @param integer[] $originalPixel  A hash with 'red', 'green', and 'blue'
  *                                  values.
  *
  * @return integer[]  A hash with 'red', 'green', and 'blue' values for the
  *                    corresponding gray color.
  */
 public static function grayscalePixel($originalPixel)
 {
     $gray = Horde_Image::grayscaleValue($originalPixel['red'], $originalPixel['green'], $originalPixel['blue']);
     return array('red' => $gray, 'green' => $gray, 'blue' => $gray);
 }