首页 > 其他 > 详细

TatukGIS - GisDefs - ColorToHSL 过程

时间:2014-03-26 04:08:58      阅读:385      评论:0      收藏:0      [点我收藏+]

过程名称  ColorToHSL

所在单元  GisDefs 

过程原型  

          procedure ColorToHSL(const _color: TColor; var _h: Real; var _s: Real; var _l: Real);         

过程说明 

   根据TColor 转换至 HSL颜色.   

         HSL即色相饱和度亮度英语Hue, Saturation, Lightness),又称HLS          

举例说明    


bubuko.com,布布扣
 1 var
 2   h, s, l: Real;
 3   c: TColor;
 4 begin
 5   c := RGBToColor(127,255,127);
 6   ColorToHSL(c, h, s, l);
 7   ShowMessage(Format(H = %f , S = %f , L = %f, [h*360, s, l]));
 8   c := HSLToColor(h, s, l);
 9   ShowMessage(IntToStr(c));
10   if c = RGBToColor(127,255,127) then ShowMessage(OK);
11 end;
bubuko.com,布布扣

 

RGB HSL HSV 结果
(1, 0, 0) (0°, 1, 0.5) (0°, 1, 1)  
(0.5, 1, 0.5) (120°, 1, 0.75) (120°, 0.5, 1)  
(0, 0, 0.5) (240°, 1, 0.25) (240°, 1, 0.5)  

 

TatukGIS - GisDefs - ColorToHSL 过程,布布扣,bubuko.com

TatukGIS - GisDefs - ColorToHSL 过程

原文:http://www.cnblogs.com/chinacodegear/p/3624409.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!