Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgrgb2hsv.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgrgb2hsv.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgrgb2hsv.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgrgb2hsv.html on line 8

PgRGB2HSV()

Convert RGB colors to HSV

Synopsis:

PgColorHSV_t PgRGB2HSV( PgColor_t rgb_color );

Library:

ph

Description:

This function converts composite color values into hue-saturation-value.

If you write a color selection function that allows the user to change RGB and HSV values, you should maintain the RGB and HSV values separately. So if the user changes the RGB value, you would use PgRGB2HSV() to calculate the new HSV value. For example:

HSVvalue = PgRGB2HSV( RGBvalue );

Note: When you convert RGB values into HSV, colors close to black, white, or gray might not convert to correct hue values.

This function doesn't copy any alpha value from the RGB color to the HSV color.


Returns:

A hue-saturation-value value.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgColor_t, PgColorHSV_t, PgHSV(), PgHSV2RGB(), PgSetFillColor()

Color in the Raw Drawing and Animation chapter of the Photon Programmer's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgrgb2hsv.html on line 122

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgrgb2hsv.html on line 122