Choose your controls
Four panel layouts, optional opacity and your own palette.
Choose your output
Save HEX, RGB, RGBA, HSL or HSLA strings.
Start with one field
Choose a panel layout
- Advanced
- Grid
- Swatches
- Sliders
A saturation and brightness area with a hue slider. Add opacity, channel inputs or preset swatches when needed.
showSwatches() adds circular presets to the advanced or sliders panel. On a grid panel, it changes the palette to circular swatches. Use gridColors() to choose the colors shown in any palette.
Choose the field appearance
Full field, icon or color circle
iconOnly() shows a palette icon colored with the current value. swatchOnly() shows a color circle without an outer input frame. Both omit the value text. Alternatively, use trigger('icon') or trigger('swatch') directly.
Sizes, variants and rounding
The main field shares FLEX Text Input’s appearance: three sizes, four variants, rounding and an optional focus outline. These settings affect the field;panelWidth() and panelRadius() configure the panel separately.
See Configuration for shared appearance settings. The picker supports light and dark themes. Its format selector uses the FLEX Select control, and its value inputs use shared FLEX input controls.
Always-visible panel
inline() displays the controls directly in the form and removes the opening trigger. closeOnSelect() does not hide an inline panel.
Formats and saved values
The saved format and the editing format are separate.format() determines how new color selections are written to the field. Changing the format selector changes the editing controls without changing this setting.
format('hex'), format('rgb'), format('rgba'), format('hsl') and format('hsla') are equivalent configuration choices. hsla() enables opacity automatically; rgba() does not. Use alpha() with RGBA output.
Limit the editing formats
allowedFormats().
With opacity disabled, rgba and hsla configuration choices become rgb and hsl. Duplicate choices are removed.
Existing valid color strings are not converted simply by opening a form. Conversion to the configured output happens when the user changes the color.
allowedFormats() controls editing choices; it does not reject an existing color solely because it uses another supported representation.Opacity
Opacity is off by default. Enable it to show the opacity slider and preserve transparency.opacity() is an alias for alpha().
Custom palettes
Show brand colors alongside the full picker:gridColors() accepts up to 512 valid color strings and removes duplicate strings. null or an empty list restores the default palette. Generated grids allow 1–32 columns and 1–32 rows, with at most 512 cells in total. Grid dimensions do not generate additional colors when you supply a custom palette.
A palette configures the choices shown to the user; it is not a server-side allowlist. If your application requires one of a fixed set of saved values, add an explicit validation rule.
Show only the controls you need
Hide the format selector, keep the screen-color picker
Hide the format selector, keep the screen-color picker
Use one color-string input instead of separate channels
Use one color-string input instead of separate channels
channelFields(true), RGB and HSL have individual channel inputs; HEX has one string input.Hide numeric fields
Hide numeric fields
showFields(); use showFormatSelector(false) to hide it there.Hide slider labels or the main value text
Hide slider labels or the main value text
showChannelLabels(false) hides the headings and numeric readouts above sliders. showValue(false) hides the main field’s color text. Neither removes the controls’ accessible labels.Turn off the screen-color picker
Turn off the screen-color picker
Panel position and motion
Use
animationDuration(0) to disable transitions. The picker also respects reduced-motion preferences.
Validation and database storage
The field stores a color string, or an empty value when optional. Use a nullable string column for optional colors; a length of 128 accommodates every accepted value. No JSON column or color-specific model cast is required. The built-in server rule checks color syntax and channel ranges. Supported inputs are:
Named colors such as
red, four-digit HEX, CSS variables, URLs, CSS expressions and strings longer than 128 characters are not accepted. Modern space-separated CSS color notation is not supported. Empty values are allowed unless you use required().
rule() or rules(); use Data & validation for form saving guidance.
Read-only and disabled fields
React to a changed color
Keyboard controls
You can also drag the color area and sliders with a pointer or touch. Opening the nested format selector keeps the color picker available.
Configuration reference
These are the Color Picker’s configuration methods. Setters with a value parameter also accept a closure, so each field can resolve its settings from the current form or record.
Invalid layout names, unsupported formats and out-of-range panel or grid settings are rejected when the field configuration is resolved.