Image_Color2
[ class tree: Image_Color2 ] [ index: Image_Color2 ] [ all elements ]

Class: Image_Color2_Model_Named

Source Location: /Image_Color2-0.1.5/Image/Color2/Model/Named.php

Class Overview


Named color model represents colors by looking up the "webstandard" name in a list of corresponding RGB values.


Author(s):

Copyright:

  • 2005

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 43]
Named color model represents colors by looking up the "webstandard" name in a list of corresponding RGB values.

This class is based on code written by Sebastian Bergmann for Image_Color.



[ Top ]


Class Variables

$_name =  ''

[line 48]

Name of this color. It should exist in self::$_colornames.
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 206]

Image_Color2_Model_Named __construct( string $name)

Construct a named color.
  • Access: protected

Parameters:

string   $name   —  A color name in self::$_colorname. It will be converted to lowercase and spaces will be removed before trying to match it.

[ Top ]

fromArray   [line 241]

Image_Color2_Model_Named fromArray( array $array)

  • Access: public

Parameters:

array   $array   —  with the color name as a string in the first element. The name will be converted to lowecase and spaces will be removed before trying to match it against the list of known colors.

[ Top ]

fromRgb   [line 222]

Image_Color2_Model_Named fromRgb( array $rgb)

  • Access: public

Parameters:

array   $rgb   —  A PEAR style RGB array containing three integers from 0 to 255 for the Red, Green, and Blue color components followed by a 'type' => 'rgb' element.

[ Top ]

fromString   [line 253]

Image_Color2_Model_Named fromString( string $str)

  • Access: public

Parameters:

string   $str   —  A color name. The name will be converted to lowecase and spaces will be removed before trying to match it against the list of known colors.

[ Top ]

getArray   [line 276]

array getArray( )

  • Return: An array with two elements, the first is the color name the second is the type => named.
  • Access: public

[ Top ]

getRgb   [line 264]

array getRgb( )

  • Return: A PEAR style RGB array containing three integers from 0 to 255 for the Red, Green, and Blue color components followed by a 'type' => 'rgb' element.
  • Access: public

[ Top ]

getString   [line 285]

string getString( )

  • Return: The name of the color.
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:39:06 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.