Difference between revisions of "RGBToHSL"

From SCAR Divi Manual
Jump to: navigation, search
(See Also)
Line 26: Line 26:
 
==See Also==
 
==See Also==
 
*[[HSLToRGB]]
 
*[[HSLToRGB]]
*[[ColorToHSL]]
+
*[[RGBToColor]]
*[[XYZToHSL]]
+
*[[RGBToXYZ]]
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Color Functions]]
 
[[Category:Color Functions]]
 
[[Category:Conversion Functions]]
 
[[Category:Conversion Functions]]

Revision as of 17:40, 3 July 2011

Definition

procedure RGBtoHSL(R, G, B: Integer; var H, S, L: Extended);

Availability

SCAR Divi 3.00 > Current

Description

Converts RGB values specified by R, G and B to color components within the HSL color space and returns them in H, S and L. The HSL values are defined as percentages within the range 0..100. The result can be converted back to RGB values using HSLToRGB.

Example

var
  H, S, L: Extended;

begin
  RGBtoHSL(0, 255, 0, H, S, L);
  WriteLn(FloatToStr(H) + ';' + FloatToStr(S) + ';' + FloatToStr(L));
end.

Output:

33,3333343267441;100;50

See Also