Zeta Components Manual :: Docs For Class ezcGraphColor
Graph::ezcGraphColor
Class ezcGraphColor
ezcGraphColor
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.
Source for this file: /Graph/src/colors/color.php
ezcBaseOptions | --ezcGraphColor
Version: | //autogentag// |
Descendants
Child Class | Description |
---|---|
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. |
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. |
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 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 |
darken(
$value
)
Returns a copy of the current color darkened by the given factor |
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
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
- Array of integers
- Array of floats
Parameters:
Name | Type | Description |
---|---|---|
$color |
mixed | Some kind of color definition |
fromFloatArray
Creates an ezcGraphColor object from an array of floats
Parameters:
Name | Type | Description |
---|---|---|
$array |
array | Array of float color values |
fromHex
Creates an ezcGraphColor object from a hexadecimal color representation
Parameters:
Name | Type | Description |
---|---|---|
$string |
mixed | Hexadecimal color representation |
fromIntegerArray
Creates an ezcGraphColor object from an array of integers
Parameters:
Name | Type | Description |
---|---|---|
$array |
array | Array of integer color values |
darken
Returns a copy of the current color darkened by the given factor
Parameters:
Name | Type | Description |
---|---|---|
$value |
float | Percent to darken the color |
invert
Inverts and returns a copy of the current color
transparent
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 |