Siticone Logo
Siticone UI
DOCS
v2025.12.15
Docs Color Picker Button

Siticone Color Picker Button

The SiticoneColorPickerButton acts as both a trigger and a preview for color selection. Clicking it opens a standard color dialog (or triggers a custom event), and the button's appearance automatically updates to reflect the chosen color.

Color Selection

The core functionality revolves around managing the selected color.

Property Type Description
SelectedColor Color The currently selected color. Setting this property updates the button's appearance (Fill or Border) depending on the style.
DefaultColor Color The fallback color used when resetting or initializing the control.
AllowOpacity bool If true, allows picking colors with alpha transparency (if supported by the dialog).

Visual Style

Customize how the selected color is displayed on the button.

Property Type Description
ColorPreviewMode Enum
  • Background: Fills the entire button with the selected color.
  • Border: Only colors the button border.
  • Icon: Only colors the button icon/image.
  • Text: Only colors the button text.
ShowColorText bool If true, displays the color's Hex or RGB value as text on the button.
ColorTextFormat string Format string for color text (e.g., "Hex", "RGB", "Name").

Events

Events specific to color selection.

ColorSelected Event
// Fired when a new color is confirmed.
colorBtn.ColorSelected += (s, e) => 
{
                Console.WriteLine($"Color Picked: {e.HexValue}");
    
                // Apply to target control
    panel1.BackColor = e.SelectedColor;
};

Designer Support

The control includes a Smart Tag menu for quick configuration.

Category Features
Quick Colors One-click presets for common colors (Red, Green, Blue, etc.).
Settings Copy/Paste visual settings between multiple buttons.

Usage Examples

Example 1: Theme Color Picker

A button that lets users pick an accent color for the application.

C# - Theme Setup
private void SetupAccentPicker()
{
    btnAccent.SelectedColor = Properties.Settings.Default.AccentColor;
    btnAccent.ColorPreviewMode = ColorPreviewMode.Background;
    
                // Show the Hex code
    btnAccent.ShowColorText = true;
    btnAccent.ColorTextFormat = "Hex"; // e.g., "#FF5733"
    
    btnAccent.ColorSelected += (s, e) => 
    {
                UpdateAppTheme(e.SelectedColor);
    };
}

Example 2: Text Color Tool

A toolbar button for changing text color in a rich text editor.

C# - Text Tool
private void SetupTextTool()
{
    btnTextColor.SelectedColor = Color.Black;
    btnTextColor.ColorPreviewMode = ColorPreviewMode.Icon; // Only color the 'A' icon
    btnTextColor.Image = Properties.Resources.icon_font;
    
    btnTextColor.ColorSelected += (s, e) => 
    {
        richTextBox1.SelectionColor = e.SelectedColor;
    };
}