Path

ez components / documentation / api reference / latest / graph


eZ Components latest

Graph: ezcGraphColor

[ Tutorial ] [ Gallery ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcGraphColor

ezcGraphColor [source]
Struct for representing colors in ezcGraph. A color is defined using the common RGBA model with integer values between 0 and 255. An alpha value of zero means full opacity, while 255 means full transparency.

Parents

ezcBaseOptions
   |
   --ezcGraphColor

Descendents

Child Class Description
ezcGraphLinearGradient Class representing linear gradient fills. For drivers which cannot draw gradients it falls back to a native ezcGraphColor. In this case the start color of the gradient will be used.
ezcGraphRadialGradient Class representing radial gradient fills. For drivers which cannot draw gradients it falls back to a native ezcGraphColor. In this case the start color of the gradient will be used.

Properties

integer read/write  $alpha
Alpha RGBA value of color.
integer read/write  $blue
Blue RGBA value of color.
integer read/write  $green
Green RGBA value of color.
integer read/write  $red
Red RGBA value of color.

Inherited Member Variables

From ezcBaseOptions:
protected  ezcBaseOptions::$properties

Method Summary

public static ezcGraphColor create( $color )
Tries to parse provided color value
public ezcGraphColor darken( $value )
Returns a copy of the current color darkened by the given factor
public static ezcGraphColor fromFloatArray( $array )
Creates an ezcGraphColor object from an array of floats
public static ezcGraphColor fromHex( $string )
Creates an ezcGraphColor object from a hexadecimal color representation
public static ezcGraphColor fromIntegerArray( $array )
Creates an ezcGraphColor object from an array of integers
public ezcGraphColor invert( )
Inverts and returns a copy of the current color
public ezcGraphColor transparent( $value )
Returns a copy of the current color made more transparent by the given factor

Inherited Methods

From ezcBaseOptions :
public ezcBaseOptions ezcBaseOptions::__construct()
Construct a new options object.
public void ezcBaseOptions::merge()
Merge an array into the actual options object.
public bool ezcBaseOptions::offsetExists()
Returns if an option exists.
public mixed ezcBaseOptions::offsetGet()
Returns an option value.
public void ezcBaseOptions::offsetSet()
Set an option.
public void ezcBaseOptions::offsetUnset()
Unset an option.

Methods

create

ezcGraphColor create( mixed $color )
Tries to parse provided color value
This method can be used to create a color struct from arbritrary color representations. The following values are accepted
  • Hexadecimal color definitions, like known from HTML, CSS and SVG
Color definitions like #FF0000, with and and without number sign, where each pair of bytes is interpreted as a color value for the channels RGB(A). These color values may contain up to 4 values, where the last value is considered as the alpha channel.
  • Array of integers
If an array of integers is provided as input teh value in each channel may be in the span [0 - 255] and is assigned to the color channels RGB(A). Up to four values are used from the array.
  • Array of floats
If an array of floats is provided as input teh value in each channel may be in the span [0 - 1] and is assigned to the color channels RGB(A). Up to four values are used from the array.

Parameters

Name Type Description
$color mixed Some kind of color definition

darken

ezcGraphColor darken( float $value )
Returns a copy of the current color darkened by the given factor

Parameters

Name Type Description
$value float Percent to darken the color

fromFloatArray

ezcGraphColor fromFloatArray( $array )
Creates an ezcGraphColor object from an array of floats

Parameters

Name Type Description
$array array Array of float color values

fromHex

ezcGraphColor fromHex( mixed $string )
Creates an ezcGraphColor object from a hexadecimal color representation

Parameters

Name Type Description
$string mixed Hexadecimal color representation

fromIntegerArray

ezcGraphColor fromIntegerArray( $array )
Creates an ezcGraphColor object from an array of integers

Parameters

Name Type Description
$array array Array of integer color values

invert

ezcGraphColor invert( )
Inverts and returns a copy of the current color

transparent

ezcGraphColor transparent( mixed $value )
Returns a copy of the current color made more transparent by the given factor

Parameters

Name Type Description
$value mixed Percent to make color mor transparent

Last updated: Mon, 21 Dec 2009