Difference between revisions of "ColorToHSL"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> procedure ColortoHSL(C: Integer; var H, S, L: Extended); </source> ==Availability== SCAR Divi 3.00 > Current ==Description== C...")
 
 
Line 1: Line 1:
 
==Definition==
 
==Definition==
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
procedure ColortoHSL(C: Integer; var H, S, L: Extended);
+
procedure ColorToHSL(C: Integer; var H, S, L: Extended);
 
</source>
 
</source>
  
Line 8: Line 8:
  
 
==Description==
 
==Description==
Converts a given color value '''C''' to [http://en.wikipedia.org/wiki/HSL_and_HSV HSL] values and returns them in '''H''', '''S''' and '''L'''. The components can be joined back together into a color value using [[HSLtoColor]].
+
Converts a given color value '''C''' to [http://en.wikipedia.org/wiki/HSL_and_HSV HSL] values and returns them in '''H''', '''S''' and '''L'''. The components can be joined back together into a color value using [[HSLToColor]].
  
 
==Example==
 
==Example==

Latest revision as of 11:07, 5 July 2011

Definition

procedure ColorToHSL(C: Integer; var H, S, L: Extended);

Availability

SCAR Divi 3.00 > Current

Description

Converts a given color value C to HSL values and returns them in H, S and L. The components can be joined back together into a color value using HSLToColor.

Example

var
  h, s, l: Extended;

begin
  ColorToHSL(123456, h, s, l);
  WriteLn(FloatToStr(h) + ';' + FloatToStr(s) + ';' + FloatToStr(l));
end.

Output:

28,6666661500931;99,1189420223236;44,5098042488098

See Also