Color Swatch Picker
A ColorSwatchPicker component with COUI style.
A horizontal row of circular color swatches with an animated selection ring, mirroring the ColorOS 16 icon mono-color selector (UxColorSelectableView): a 34dp color dot inside a 44dp cell, with a 2dp theme-colored ring that fades in on selection.
Note: colors is a standard List, which Compose treats as unstable; build it inside a remember { } block (or keep the same instance across compositions) to avoid needless recompositions.
Parameters
The list of colors to display as swatches.
The index of the currently selected swatch, or a negative value for none.
The callback invoked with the index of the swatch the user selects.
The modifier to be applied to the ColorSwatchPicker.
Whether the ColorSwatchPicker is enabled.
The diameter of each color dot (COUI ux_icon_color_select_inside).
The touch target / selection ring outer diameter (COUI ux_icon_color_select_out).
The stroke width of the selection ring (COUI ux_theme_shadow_stroke).
The color of the selection ring (COUI couiColorPrimary).
The spacing between adjacent cells.