How to add Color picker field in ui component form Magento 2?

You can add the color picker field in the Ui Component form in the admin panel of the Magento. Using color picker you can choose a color from predefined color tree structure, add your custom color hash code or create specific color using adjusting color slider.

I have added color picker field in category form to show a demo of color picker in UI Component form XML.

Use formElement as colorPicker in XML file with field tag. <field name=”background_color” sortOrder=”10″ formElement=”colorPicker”>

Valid Form Component XML file will be as per given example,

You need to use above XML structure to set color picker using UI component form.

color-picker-magento
Color picker Ui Component Magento

Color Picker Basic settings:
* colorPickerMode: Defines the mode that affects available color picker functionality
Valid modes value will be: simple, full, noalpha, palette

* colorFormat: Defines the color format that is displayed in the selection tool as well as in the input field.
Valid formats value: hex, rgb, hsl, hsv, name, none

 * placeholder: Field’s Place holder value at initial form page load.