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

Class: Image_Color2_Model_Hsv

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

Class Overview


HSV (also called HSB) color model defines colors in terms of Hue, Saturation, and Value (or Brightness).


Author(s):

Copyright:

  • 2005

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 38]
HSV (also called HSB) color model defines colors in terms of Hue, Saturation, and Value (or Brightness).


[ Top ]


Class Variables

$_h =

[line 43]

Hue component
  • Var: 0-360
  • Access: protected

Type:   integer


[ Top ]

$_s =

[line 48]

Saturation component
  • Var: 0.0-1.0
  • Access: protected

Type:   float


[ Top ]

$_v =

[line 53]

Value component
  • Var: 0.0-1.0
  • Access: protected

Type:   float


[ Top ]



Method Detail

__construct (Constructor)   [line 62]

Image_Color2_Model_Hsv __construct( integer $h, float $s, float $v)

Construct from HSV components.
  • Access: protected

Parameters:

integer   $h   —  0 - 360
float   $s   —  0.0 - 1.0
float   $v   —  0.0 - 1.0

[ Top ]

fromArray   [line 134]

Image_Color2_Model_Hsv fromArray( array $array)

Pull the HSV components out of the array and return a color model object.

Hue is a integer degree between from 0 to 360 and the Saturation and Value are floats between 0 and 1.

  • Access: public

Parameters:

array   $array   —  with Hue as first element, Saturation as the second and Value as the third.

[ Top ]

fromRgb   [line 77]

Image_Color2_Model_Hsv fromRgb( array $rgb)

Convert the RGB array into HSV components and return a new Model class.
  • 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 146]

Image_Color2_Model_Hsv fromString( string $str)

Pull the HSV components out of the string and return a color model object. Hue is a integer degree between from 0 to 360 and the Saturation and Value are either percentages or values between 0 and 1.
  • Access: public

Parameters:

string   $str   —  in the form '120, 25%, 50%' or '120, .25, .50'

[ Top ]

getArray   [line 233]

array getArray( )

  • Access: public

[ Top ]

getRgb   [line 164]

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 247]

string getString( )

  • Return: In the format 'H S% V%'.
  • 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.