![]() |
(SST) ShlWAPI.pas Version 1.08 |
---|---|
Developer Reference |
Returns the hue, luminance, and saturation, corresponding to the specified red, green, and blue values. |
Scope |
---|
Global (i.e. this function can be called/accessed from code in any unit that includes/uses (SST)ShlWAPI.pas). |
Syntax | |
---|---|
Procedure ColorRGBToHLS(clrRGB : COLORREF; pwHue : PWORD; pwLuminance : PWORD; pwSaturation : PWORD); |
Parameters | |
---|---|
clrRGB [in] | A COLORREF value, containing the red, green, and blue values of the color for which to retrueve the corresponding hue, luminance, and saturation. |
pwHue [out] | The address of, or pointer to, a 16 bit, word variable that when the function returns, has been set to the hue of the color. |
pwLuminance [out] | The address of, or pointer to, a 16 bit, word variable that when the function returns, has been set to the luminance of the color. |
pwSaturation [out] | The address of, or pointer to, a 16 bit, word variable that when the function returns, has been set to the saturation of the color. |
Return Values | |
---|---|
None (i.e. this function does not return a value). |
Example |
---|
PROCEDURE TForm4.TestShlWAPIColorRGBToHLS(Sender : TObject); VAR rgbcolor : COLORREF; VAR hue : WORD; //the H of the HLS VAR luminance : WORD; //the L of the HLS VAR saturation : WORD; //the S of the HLS VAR newinfoline : STRING; BEGIN rgbcolor := 0; hue := 0; luminance := 0; saturation := 0; newinfoline := ''; rgbcolor := $005C4873; ColorRGBToHLS(rgbcolor, @hue, @luminance, @saturation); newinfoline := 'ColorRGBToHLS called with a RGB value of 0x' + IntToHex(rgbcolor, 8) + ' (' + IntToStr(rgbcolor) + ')'; Memo1.Lines.Add(newinfoline); newinfoline := 'returned a hue (H) of ' + IntToStr(hue) + ', a luminance (L) of ' + IntToStr(luminance) + ', and a saturation (S) of ' + IntToStr(saturation); Memo1.Lines.Add(newinfoline); Memo1.Lines.Add(''); END; |
The above example will produce the following output: |
ColorRGBToHLS called with a RGB value of 0x005C4873 (6047859) returned a hue (H) of 221, a luminance (L) of 88, and a saturation (S) of 55 |
Requirements | |
---|---|
Unit: | Declared and imported in (SST)ShlWAPI.pas |
Library: | (SST)ShlWAPI.dcu/(SST)ShlWAPI.obj |
Unicode: | Not applicable. |
Min. ShlWAPI.dll version according to MS SDK doc.: | 5.0 |
Min. ShlWAPI.dll version based on SST research: | 5.0 |
Min. OS version(s) according to Microsoft SDK doc.: | Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5 |
Min. OS version(s) according to SST research.: | Windows NT 4.0 with IE 5, Windows 95 with IE 5, Windows 98 with IE 5, Windows 98 SE, Windows 2000 and later |
See Also |
---|
ColorAdjustLuma, ColorHLSToRGB, SHCreateShellPalette, SHGetInverseCMAP |
Windows APIs: ColorAdjustLuma, ColorHLSToRGB, ColorRGBToHLS, SHCreateShellPalette, SHGetInverseCMAP, |
Document/Contents version 1.00 Page/URI last updated on May 04, 2022 |
Copyright © Stoelzel Software Technologie (SST) 2010 - 2017 |
Suggestions and comments mail to: webmaster@stoelzelsoftwaretech.com |