What tools are used for working with HSL colors in .net?
original title: ".net - how to use HSL in Asp.net"
What tools are used for working with HSL colors in .net?
Milyen eszközöket használnak a .Lt-ben a HSL színek kezelésére?
Ez az összefoglalás a fordítás után. Ha meg szeretné tekinteni a teljes fordítást, kattintson a "fordítás" ikonra
The color struct provides three methods: GetHue, GetSaturation and GetBrightness.
Bob Powell wrote an interesting piece on this several years ago.
Bizarre historical note -- "HSL" (and the related "HSV") are one of the many things originating from Xerox's Palo Alto Research Center (PARC) in the 70's, courtesy of Alvy Ray Smith.
This ColorRGB class provides ways to get and set HSL, along with implicit conversions to and from System.Drawing.Color. It's based on an excellent example from GeekMonkey.com.
In addition to secretGeek's answer, to get a color from HSL values (or vice-versa), you can also use these native function calls (sample code in Visual Basic):
(using
ColorTranslator.ToWin32
andColorTranslator.FromWin32
when passing/receiving the color argument/result)