ColorHLSToRGB (shlwapi)
Last changed: wageoghe-65.208.22.25

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

C# Signature:

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

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