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

Class: Image_Color2_Model_Hsl

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

Class Overview


HSL (also called HSI or HLS) color model defines colors in terms of Hue, Saturation, and Lightness (also Luminance, Luminosity or Intensity).


Author(s):

Copyright:

  • 2005

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 42]
HSL (also called HSI or HLS) color model defines colors in terms of Hue, Saturation, and Lightness (also Luminance, Luminosity or Intensity).

CSS3 allows the use of this color model to define colors.



[ Top ]


Class Variables

$_h =

[line 47]

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

Type:   integer


[ Top ]

$_l =

[line 57]

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

Type:   float


[ Top ]

$_s =

[line 52]

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

Type:   float


[ Top ]



Method Detail

__construct (Constructor)   [line 66]

Image_Color2_Model_Hsl __construct( integer $h, float $s, float $l)

Constuct from a integer for Hue, and two floats for Saturation and Lightness.
  • Access: protected

Parameters:

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

[ Top ]

fromArray   [line 137]

Image_Color2_Model_Hsl fromArray( array $array)

Pull the HSL 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 Lightness are floats between 0 and 1.
  • Access: public

Parameters:

array   $array   —  An array with the Hue as an integer 0-360 in the first element, Saturation and Lightness as floats 0.0-1.0 in the second as the third elements respectively.

[ Top ]

fromRgb   [line 79]

Image_Color2_Model_Hsl 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 149]

Image_Color2_Model_Hsl fromString( string $str)

Pull the HSL components out of the string and return a color model object. Hue is a integer degree between 0 and 360 while the Saturation and Lightness 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 231]

array getArray( )

  • Access: public

[ Top ]

getRgb   [line 167]

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

string getString( )

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