MindFusion.UI for WebForms Programmer's Guide

ColorEditor

The ColorEditor control represents a customizable web color editor. It supports three different color models - RGB, HSV and HSB.

Server side

  • Getting and setting the control's value
    Use the ColorEditor.SelectedColor property to get or set the control's current value.

  • Customizing the control
    Use the PaletteMode property to set the control's displayed palette.

  • Events
    The following events are exposed by the ColorEditor class.

    Event

    Event arguments

    Description

    ColorChanged

    ValueChangedEventArgs<Color>

    Raised when the control's selected color has changed.

Client side

  • Getting a reference to the control
    You can access the control on the client side by its ClientID.
     
    JavaScript  Copy Code
    var colorEditor = $find("ColorEditor1");
    var colorEditor = $find("<%= ColorEditor1.ClientID %>");


  • Getting and setting the control's selected color.
    Use the get_selectedColor and selectColor methods to get or set the control's selected color.

    JavaScript  Copy Code

    colorEditor.selectColor("#ff00ff");
    colorEditor.selectColor("fuchsia");
    colorEditor.selectColor("#f0f");
    alert(colorEditor.get_selectedColor());