/HSVClass.php

Description

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.

Classes
Class Description
HSVClass The HSV Class and the accompanying functions allow you to convert between HSV and RGB.
Functions
convertHSVtoRGB (line 403)

Converts HSV to RGB

RGB is made up of three components, each having a possible value of 0 to 255. HSV is made up of three components, with H, the Hue, having the possible values of 0 to 360, while the other two having possible values 0 to 1.

By passing in HSV in array format, you will recieve back RGB in array format.

The RGB array is in the following format: array("r"=>?, "g"=>?, "b"=>?)

The HSV should be in the following format array("h"=>?, "s"=>?, "v"=>?);

  • return: containing the HSV, or null if there is a problem
array convertHSVtoRGB (array $arg_hsv)
  • array $arg_hsv: One element for H,S, and V. i.e array("h"=>?, "s"=>?, "v"=>?)
convertHSVtoRGBString (line 354)

Convert HSV to RGB String

Converts an HSV value into an RGB string for use in HTML

  • return: HTML RGB string
string convertHSVtoRGBString (mixed $arg_h, mixed $arg_s, mixed $arg_v, float $m_hue, float $m_brightness, float $m_saturation)
  • float $m_hue: is the hue of the color
  • float $m_brightness: is the
  • float $m_saturation: contains the saturation of the color
convertRGBtoHSV (line 288)

Converts RGB to HSV

RGB is made up of three components, each having a possible value of 0 to 255. HSV is made up of three components, with H, the Hue, having the possible values of 0 to 360, while the other two having possible values 0 to 1.

By passing in RGB in array format, you will recieve back HSV in array format.

The RGB array should be in the following format: array("r"=>?, "g"=>?, "b"=>?)

The returned hsv is in the following format array("h"=>?, "s"=>?, "v"=>?);

  • return: containing the HSV, or null if there is a problem
array convertRGBtoHSV (mixed $arg_rgb, array $arg)
  • array $arg: RGB One element for each component. i.e. array("r"=>?, "g"=>?, "b"=>?)

Documentation generated on Tue, 06 Sep 2005 00:57:19 -0400 by phpDocumentor 1.3.0RC3