PHP Class Horde_Image, horde

Author: Chuck Hagenbuch ([email protected])
Author: Michael J. Rubinsky ([email protected])
Author: Jan Schneider ([email protected])
Datei anzeigen Open project: horde/horde Class Usage Examples

Public Methods

Method Description
arcPoints ( integer $r, integer $start, integer $end ) : array Returns point coordinates at the limits of an arc.
brightness ( string $color ) : integer Returns the brightness of a color.
circlePoint ( float $degrees, integer $diameter ) : array Returns an x,y pair on circle, assuming center is 0,0.
getColor ( string $color ) : integer[] Normalizes an HTML color.
getFontSize ( $fontsize ) Returns the point size for an HTML font size name.
getHexColor ( string $colorname ) : string Returns the hexadecimal representation of an HTML color name.
getRGB ( string $colorname ) : array Returns the RGB values for an HTML color name.
grayscalePixel ( integer[] $originalPixel ) : integer[] Turns an RGB value into grayscale.
grayscaleValue ( integer $r, integer $g, integer $b ) : integer Calculates the grayscale value of a color.
modifyColor ( string $color, integer $factor = 17 ) : string Calculates a lighter (or darker) version of a color.
moreIntenseColor ( string $color, integer $factor = 17 ) : string Calculates a more intense version of a color.

Method Details

arcPoints() public static method

Returns point coordinates at the limits of an arc.
public static arcPoints ( integer $r, integer $start, integer $end ) : array
$r integer The radius of the arc.
$start integer The starting angle.
$end integer The ending angle.
return array The start point (x1,y1), end point (x2,y2), and anchor point (x3,y3).

brightness() public static method

Returns the brightness of a color.
public static brightness ( string $color ) : integer
$color string An HTML color, e.g.: #ffffcc.
return integer The brightness on a scale of 0 to 255.

circlePoint() public static method

Returns an x,y pair on circle, assuming center is 0,0.
public static circlePoint ( float $degrees, integer $diameter ) : array
$degrees float The degrees of arc to get the point for.
$diameter integer The diameter of the circle.
return array (x coordinate, y coordinate) of the point.

getColor() public static method

Normalizes an HTML color.
public static getColor ( string $color ) : integer[]
$color string An HTML color, e.g.: #ffffcc or #ffc.
return integer[] Array with three elements: red, green, and blue.

getFontSize() public static method

Returns the point size for an HTML font size name.
public static getFontSize ( $fontsize )

getHexColor() public static method

Returns the hexadecimal representation of an HTML color name.
public static getHexColor ( string $colorname ) : string
$colorname string A color name.
return string The hex representation of the color.

getRGB() public static method

Returns the RGB values for an HTML color name.
public static getRGB ( string $colorname ) : array
$colorname string A color name.
return array An array of RGB values.

grayscalePixel() public static method

Turns an RGB value into grayscale.
public static grayscalePixel ( integer[] $originalPixel ) : integer[]
$originalPixel integer[] A hash with 'red', 'green', and 'blue' values.
return integer[] A hash with 'red', 'green', and 'blue' values for the corresponding gray color.

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.

modifyColor() public static method

Calculates a lighter (or darker) version of a color.
public static modifyColor ( string $color, integer $factor = 17 ) : string
$color string An HTML color, e.g.: #ffffcc.
$factor integer The brightness difference between -0xff and +0xff. Plus values raise the brightness, negative values reduce it.
return string A modified HTML color.

moreIntenseColor() public static method

Calculates a more intense version of a color.
public static moreIntenseColor ( string $color, integer $factor = 17 ) : string
$color string An HTML color, e.g.: #ffffcc.
$factor integer The intensity difference between -0xff and +0xff. Plus values raise the intensity, negative values reduce it.
return string A more intense HTML color.