ColorHLSToRGB (shlwapi)
Last changed: french.software.company@gmail.com-165.225.76.101

.
Summary
Converts colors from hue-luminance-saturation (HLS) to RGB format.

C# Signature:

[System.Runtime.InteropServices.DllImport("shlwapi.dll")]
static extern int ColorHLSToRGB(int H, int L, int S);

VB.Net Signature:

<System.Runtime.InteropServices.DllImport("shlwapi.dll", EntryPoint:="ColorHLSToRGBW", SetLastError:=True, CharSet:=System.Runtime.InteropServices.CharSet.Unicode)>
Public Shared Function ColorHLSToRGB(H As Integer, L As Integer, S As Integer) As Integer
End Function

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

  using System;
  using System.Drawing;
  using System.Runtime.InteropServices;
  sealed class Win32
  {
    [DllImport("shlwapi.dll")]
    static extern int ColorHLSToRGB(int H, int L, int S);

    static public System.Drawing.Color HLSToColor(int H,int L,int S)
    {
      //
      // Convert Hue, Luminance, and Saturation values to System.Drawing.Color structure.
      // H, L, and S are in the range of 0-240.
      // ColorHLSToRGB returns a Win32 RGB value (0x00BBGGRR).  To convert to System.Drawing.Color
      // structure, use ColorTranslator.FromWin32.
      //
      return ColorTranslator.FromWin32(ColorHLSToRGB(H,L,S));
    }
  }

Documentation