如何用Delphi根据色调和亮度对色彩调色板进行高效排序?

2026-04-10 21:052阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计193个文字,预计阅读时间需要1分钟。

如何用Delphi根据色调和亮度对色彩调色板进行高效排序?

我有一些颜色列表(TColor)存储在数组中,我喜欢使用HUE排序加Luminosity排序。Delphi库中有没有包含这种功能或算法的组件?Delphi包中有一个名为GraphUtil的单元,它包含一个名为SortColorArray的函数。

我有几个颜色列表(TColor)存储在数组中我喜欢使用HUE排序o Luminosity存在任何delphi库或具有这种功能或算法的组件? Delphi包含一个名为GraphUtil的单元,它具有一个名为 SortColorArray的函数

如何用Delphi根据色调和亮度对色彩调色板进行高效排序?

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;

本文共计193个文字,预计阅读时间需要1分钟。

如何用Delphi根据色调和亮度对色彩调色板进行高效排序?

我有一些颜色列表(TColor)存储在数组中,我喜欢使用HUE排序加Luminosity排序。Delphi库中有没有包含这种功能或算法的组件?Delphi包中有一个名为GraphUtil的单元,它包含一个名为SortColorArray的函数。

我有几个颜色列表(TColor)存储在数组中我喜欢使用HUE排序o Luminosity存在任何delphi库或具有这种功能或算法的组件? Delphi包含一个名为GraphUtil的单元,它具有一个名为 SortColorArray的函数

如何用Delphi根据色调和亮度对色彩调色板进行高效排序?

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;