CodeBase - HSV 2 DWORD

Return to the CodeBase listing

Category: Basic 2D

Version: 1.0

0
0

Information

Uploaded: 23rd Dec 2006 12:01

Modified: 1st Jan 1970 01:00

Author:  Nicholas Thompson

Summary

Function to convert HSV values to a DWORD (as produced by the RGB function)

Full Description

Sometimes you want to control the COLOUR of a colour without changing the saturation or the value/brightness. This is next to impossible to do with pure RGB values, but it is often quite a useful thing to do (for example creating random but equally visible colours for a game). DBP doesn't handle HSV internally (AFAIK) so here is a function with remarks to do just that. Provide a Hue in the range of 0.0 to 360.0 and a Saturation and Brightness in the range of 0.0 to 1.0 and it will return a DWORD of that colour. For more information on HSV, see:<br /> http://en.wikipedia.org/wiki/HSV_color_space

Comments

No comments yet.