The HSV Class and the accompanying functions allow you to convert between HSV and RGB.
RGB is what the computer understands. HSV is what people can use to easily work with colors. This code gives you the tools to convert between the two models.
PHP Version 4
LICENSE: This class is subject to the freebsd license found at http://freebsd.org/copyright/license.html.
Located in /HSVClass.php (line 42)
Constructor - initializes the variables
Alters the brightness of the current color
The value passed in should be greater than negative one and less than one. If by changing brightness it becomes greater than one or less than zero, the brightness wraps around. For instance, adding +.2 to a value of .9 leaves you with .1
Alters the hue of the current color
Alters the saturation of the current color
The value passed in should be greater than -1 and less than 1. If by changing the saturation the value becomes greater than 1 or less than 0, the brightness wraps around. For instance, adding +.2 to a value of .9 leaves you with .1.
Returns an array containing the hue, saturation and brightness
Returns array of the current color
Return HTML string of current color
sets the current color
Sets the HSV values, overwriting whatever was there previously.
sets the current color
The RGB is immediately converted in HSV and stored
sets the current color
Sets the HSV values, overwriting whatever was there previously. The string is in #FFFFFF format.
Documentation generated on Tue, 06 Sep 2005 00:57:20 -0400 by phpDocumentor 1.3.0RC3