如何用Delphi根据色调和亮度对颜色调色板进行排序?
- 内容介绍
- 文章标签
- 相关推荐
本文共计204个文字,预计阅读时间需要1分钟。
我有几个颜色列表(TColor)存储在数组中,我喜欢使用HUE排序和Luminosity排序。Delphi 包含一个名为 GraphUtil 的单元,它有一个名为 SortColorArray 的函数吗?
我有几个颜色列表(TColor)存储在数组中我喜欢使用HUE排序o Luminosity存在任何delphi库或具有这种功能或算法的组件? Delphi包含一个名为GraphUtil的单元,它具有一个名为SortColorArray的函数
procedure SortColorArray(ColorArray: TColorArray; L, R: Integer; SortType: TColorArraySortType; Reverse: Boolean = False);
此功能可以按色调,饱和度,亮度,红色,绿色,蓝色对颜色列表进行排序.
你可以用这种方式
var ColorList : TColorArray; i : Integer; begin SetLength(ColorList,WebNamedColorsCount); //fill the list the colors in this case using webcolors for i := 0 to WebNamedColorsCount - 1 do begin ColorList[i].Value:=WebNamedColors[i].Value; ColorList[i].Name :=''; end; //sort the colors by HUE SortColorArray(ColorList,0,WebNamedColorsCount-1,stHue,False); //do your stuff here end;
本文共计204个文字,预计阅读时间需要1分钟。
我有几个颜色列表(TColor)存储在数组中,我喜欢使用HUE排序和Luminosity排序。Delphi 包含一个名为 GraphUtil 的单元,它有一个名为 SortColorArray 的函数吗?
我有几个颜色列表(TColor)存储在数组中我喜欢使用HUE排序o Luminosity存在任何delphi库或具有这种功能或算法的组件? Delphi包含一个名为GraphUtil的单元,它具有一个名为SortColorArray的函数
procedure SortColorArray(ColorArray: TColorArray; L, R: Integer; SortType: TColorArraySortType; Reverse: Boolean = False);
此功能可以按色调,饱和度,亮度,红色,绿色,蓝色对颜色列表进行排序.
你可以用这种方式
var ColorList : TColorArray; i : Integer; begin SetLength(ColorList,WebNamedColorsCount); //fill the list the colors in this case using webcolors for i := 0 to WebNamedColorsCount - 1 do begin ColorList[i].Value:=WebNamedColors[i].Value; ColorList[i].Name :=''; end; //sort the colors by HUE SortColorArray(ColorList,0,WebNamedColorsCount-1,stHue,False); //do your stuff here end;

