Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get Hue/Sat/Lum
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00523566
Message ID:
00523592
Views:
15
>Hi!
>
>How would I set get the Hue/Sat/Lum of the RGB() colors...
>
>Please help...

Take a look at MSKB#Q29240

Below is also a sample code to do the same using Windows API
DECLARE Long ColorHLSToRGB in "Shlwapi.dll" ;
    short wHue, short wLuminance, short wSaturation
    
DECLARE Long ColorRGBToHLS in "Shlwapi.dll" ;
    Long clrRGB, short @wHue, short @wLuminance, short @wSaturation
    

*clrRGB =  RGB( 255,0,0)
clrRGB =  RGB( 0,255,0)
*clrRGB =  RGB( 0,0,255)

? "RGB", clrRGB

Store 0 To wHue, wLuminance, wSaturation
 
= ColorRGBToHLS( clrRGB, @wHue, @wLuminance, @wSaturation)

? "HLS", wHue, wLuminance, wSaturation

clrRGB =   ColorHLSToRGB( wHue, wLuminance, wSaturation)
? "RGB", clrRGB
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform