[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/library/ezc/Graph/src/colors/ -> color.php (summary)

File containing the ezcGraphColor class

Copyright: Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
License: http://ez.no/licenses/new_bsd New BSD License
Version: 1.5
File Size: 290 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ezcGraphColor:: (9 methods):
  __construct()
  __set()
  fromHex()
  fromIntegerArray()
  fromFloatArray()
  create()
  transparent()
  invert()
  darken()


Class: ezcGraphColor  - X-Ref

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.

__construct( array $options = array()   X-Ref
Constructor

param: array $options Default option array
return: void

__set( $propertyName, $propertyValue )   X-Ref
__set

param: mixed $propertyName
param: mixed $propertyValue
return: void

fromHex( $string )   X-Ref
Creates an ezcGraphColor object from a hexadecimal color representation

param: mixed $string Hexadecimal color representation
return: ezcGraphColor

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

param: array $array Array of integer color values
return: ezcGraphColor

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

param: array $array Array of float color values
return: ezcGraphColor

create( $color )   X-Ref
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.

param: mixed $color Some kind of color definition
return: ezcGraphColor

transparent( $value )   X-Ref
Returns a copy of the current color made more transparent by the given
factor

param: mixed $value  Percent to make color mor transparent
return: ezcGraphColor New color

invert()   X-Ref
Inverts and returns a copy of the current color

return: ezcGraphColor New Color

darken( $value )   X-Ref
Returns a copy of the current color darkened by the given factor

param: float $value Percent to darken the color
return: ezcGraphColor New color



Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7