$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
How to Put up Color Settings of ColorEditor Using C#
Home > How to > Color Editor Color Setting

KT.UI for ASP.NET PerColorEditor library provides various functions of color settings with simple C# APIs and Codes. Users are able to set all the supportable color properties to create your own customized color editor. This page is arranged to display following guides on color settings within color palette:
  • C# sample codes to set EmptyColor of PerColorEditor control
  • C# demo codes for setting RecentColor property of PerColorEditor component
  • C# snippet codes to set CustomColor with support of PerColorEditor library
  • C# example codes for PreviewColor attribute of KT.UI PerColorEditor for ASP.NET

How to Use C# Codes to Set EmptyColor

The developing concept of EmptyColor is: When users choose a wrong color or you don’t want to apply any color, you can click the button is the upper right corner, then the selected color will be cleared quickly.
Please check following demo C# codes to set EmptyColor setting.

PerColorEditor1.Preset = ColorPreset.Foundry;
PerColorEditor1.ShowEmptyColor = true;

How to Use C# Codes to Set RecentColor

As you can see in the demo screenshot of RecentColor, the recently used colors are displayed in the bottom. You can directly choose the most recently used color, and then you can work with high efficiency and save a lot time. Use following demo C#.NET codes to help you program RencentColor object by applying PerColorEditor control.

PerColorEditor1.Preset = ColorPreset.Foundry;
PerColorEditor1.ShowRecentColors = true;

How to Use C# Codes to Set CustomColor

By using our color editor, users can both get a collection of preset colors, and can customize you own preferring color by evoking CustomColor property of PerColorEditor. When you are allowed to custom color, you just need to click the button, and then you will see a pop-up color selection box on which you can choose any desired color.
Please refer to following C# snippet code to set this property.

PerColorEditor1.Preset = ColorPreset.Foundry;
PerColorEditor1.EnableCustomColor = true;

How to Use C# Codes to Set PreviewColor

As described in the product functions, our users are free to choose whether display the PreviewColor within color palette or not. When users set PreviewColor as true, the selected color and color code will be displayed within the color palette. Check following simple codes for setting PreviewColor.

PerColorEditor1.Preset = ColorPreset.Origin;
PerColorEditor1.PreviewColor = true;