Class RGBColor

Description

A class designed to manipulate colors using the RGB color scheme.

  • version: $Id: RGBcolor.class.php,v 1.7 2007/09/04 20:25:54 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /harmoni/core/utilities/RGBcolor.class.php (line 15)


	
			
Variable Summary
mixed $_blue
mixed $_green
mixed $_red
Method Summary
RGBColor RGBColor (integer $red, integer $green, integer $blue)
void darken (float $percent)
integer getBlue ()
integer getGreen ()
integer getRed ()
array getRGB ()
void invert ()
void lighten (float $percent)
void replicate ()
void setBlue (integer $value)
void setGreen (integer $value)
void setRed (integer $value)
void setRGB (integer $red, integer $green, integer $blue)
void shiftBlue (integer $amount)
void shiftGreen (integer $amount)
void shiftRed (integer $amount)
void _checkColors ()
void _withinRange (integer $val, integer $min, [integer $max = 255])
Variables
mixed $_blue (line 16)
mixed $_green (line 16)
mixed $_red (line 16)
Methods
Constructor RGBColor (line 25)

Constructor. Create a new color.

  • access: public
RGBColor RGBColor (integer $red, integer $green, integer $blue)
  • integer $red: The value of the red component of the color.
  • integer $green: The value of the green component of the color.
  • integer $blue: The value of the blue component of the color.
darken (line 141)

Darken the color by a certain amount (0-100)

  • access: public
void darken (float $percent)
  • float $percent: The amount to darken the color by (0 keeps the color unchanged, 50 divides all color components by 2, 100 makes the color black.
getBlue (line 81)

Get the blue component of the color.

  • return: The value of the blue component of the color
  • access: public
integer getBlue ()
getGreen (line 71)

Get the green component of the color.

  • return: The value of the green component of the color
  • access: public
integer getGreen ()
getRed (line 62)

Get the red component of the color.

  • return: The value of the red component of the color
  • access: public
integer getRed ()
getRGB (line 90)

get all three components of the color.

  • return: The components of the color (0=>red 1=>green 2=>blue)
  • access: public
array getRGB ()
invert (line 170)

Invert the color.

  • access: public
void invert ()
lighten (line 156)

Lighten the color by a certain amount (0-100)

  • access: public
void lighten (float $percent)
  • float $percent: The amount to lighten the color by (0 keeps the color unchanged, 50 multiplies all color components by 2, 100 makes the color white.
replicate (line 206)
void replicate ()
setBlue (line 119)

set the blue component of the color.

  • access: public
void setBlue (integer $value)
  • integer $value: The value to set the blue component to (0-255).
setGreen (line 109)

set the green component of the color.

  • access: public
void setGreen (integer $value)
  • integer $value: The value to set the green component to (0-255).
setRed (line 99)

set the red component of the color.

  • access: public
void setRed (integer $value)
  • integer $value: The value to set the red component to (0-255).
setRGB (line 131)

set all three components of the color.

  • access: public
void setRGB (integer $red, integer $green, integer $blue)
  • integer $red: The value to set the red component to (0-255).
  • integer $green: The value to set the green component to (0-255).
  • integer $blue: The value to set the red component to (0-255).
shiftBlue (line 201)

Shift the red component by a certain amount.

  • access: public
void shiftBlue (integer $amount)
  • integer $amount: The amount to shift (add to or substract from) the red component by.
shiftGreen (line 191)

Shift the green component by a certain amount.

  • access: public
void shiftGreen (integer $amount)
  • integer $amount: The amount to shift (add to or substract from) the green component by.
shiftRed (line 181)

Shift the red component by a certain amount.

  • access: public
void shiftRed (integer $amount)
  • integer $amount: The amount to shift (add to or substract from) the red component by.
_checkColors (line 37)

Makes sure all the colors are within the range 0 - 255

  • access: public
void _checkColors ()
_withinRange (line 51)

Makes sure $val is within the range $min -> $max

  • access: private
void _withinRange (integer $val, integer $min, [integer $max = 255])
  • integer $val
  • integer $min
  • integer $max

Documentation generated on Wed, 19 Sep 2007 10:26:05 -0400 by phpDocumentor 1.3.0RC3