Angular Color Editor Overview (preview)

    The Ignite UI for Angular Color Editor is a lightweight color picker component. The Color Editor can pop open by clicking the brush icon. Both the rgba and hex values can be obtained from the desired color along the bottom. These values will update when the three sliders are modified. The center box is designed for adjusting the saturation and brightness along with two adjacent sliders for adjusting the rgb and luminance values. Rgb registers between (1-255). The lightness registers between(0-1).

    Angular Color Editor Example

    Dependencies

    First, you need to install the Ignite UI for Angular by running the following command:

    npm install igniteui-angular-core
    npm install igniteui-angular-inputs
    

    Before using the ColorEditor, you need to register the following modules as follows:

    Usage

    The simplest way to start using the ColorEditor is as follows:

    <igx-color-editor
        name="colorEditor"
        #colorEditor>
        </igx-color-editor>
    </div>
    

    Binding to events

    The Color Editor component raises the following events:

    • valueChanged
    • valueChanging
    @ViewChild("colorEditor", { static: true } )
    private colorEditor: IgxColorEditorComponent
    public ngAfterViewInit(): void 
    {	
        this.colorEditor.valueChanged.subscribe(this.onValueChanged);
    }
    
    public onValueChanged = (e: any) => {
        console.log("test");
    }
    

    API References

    • ColorEditor

    Additional Resources