C#,自定义调色板

C#,自定义调色板,c#,colorbox,C#,Colorbox,我必须创建一个类似的调色板。具有不同RGB组合的自定义调色板。最简单的方法是什么?[是否需要为每个自定义颜色插入图片框,或者是否存在使visual studio颜色对话框看起来像这样的选项?ColorDialogue.CustomColors属性是定义对话框显示的自定义颜色的Int数组。最简单的方法是定义硬编码的Int数组。如果您了解web-这些颜色的十六进制值您可以使用十六进制表示法,如下所示: System.Windows.Forms.ColorDialog MyDialog = new C

我必须创建一个类似的调色板。具有不同RGB组合的自定义调色板。最简单的方法是什么?[是否需要为每个自定义颜色插入图片框,或者是否存在使visual studio颜色对话框看起来像这样的选项?

ColorDialogue.CustomColors属性是定义对话框显示的自定义颜色的Int数组。最简单的方法是定义硬编码的Int数组。如果您了解web-这些颜色的十六进制值您可以使用十六进制表示法,如下所示:

System.Windows.Forms.ColorDialog MyDialog = new ColorDialog();
// Allows the user to select or edit a custom color.
MyDialog.AllowFullOpen = true ;
// Assigns an array of custom colors to the CustomColors property
// Note that the most significant byte is the alpha value,
// so most of the time it will remain FF
MyDialog.CustomColors = new int[]{ 0xFF974724, 0xFFe7eae3 };
如果您不知道颜色的十六进制值,我建议您的浏览器配备滴管附加组件,允许从网页中拾取颜色(或任何非chrome浏览器的等效组件)