Fields
6 fields you can set on a colorPicker control. Every control also takes the shared fields (id, position, span, sync, action).
Fields| Field | Type | Default | What it does |
|---|
Labellabel | text | — | The name shown above Shows this text above the color swatch. |
|---|
defaultValuedefaultValue | text | — | The starting color Sets the color shown before anyone picks one, as a hex value like #F4B860. |
|---|
Symbolicon | text | — | A small picture beside the name Draws this SF Symbol beside the label; leave it empty for no icon. |
|---|
Symbol colortint | color | — | The color of the small picture Colors the symbol beside the label, as any hex color. |
|---|
Title shownhideLabel | on / off | false (off) | Hide the title Hides the label shown above the color swatch. |
|---|
No background cardhideBackground | on / off | false (off) | Whether the card behind it is drawn Removes the frosted card behind the swatch so it sits on the page. |
|---|
Theme fields
Restyle one control by setting these in its theme object; a layout's theme sets them for every control.
Theme fields| Field | Type | Default | What it does |
|---|
cornerRadiustheme.cornerRadius | number0–30 ptstep 1 | 12 | The quieter text color Colors the smaller, secondary text. |
|---|
borderColortheme.borderColor | color | #FFFFFF1A | The outline color Colors the outline drawn around the control. |
|---|
borderWidththeme.borderWidth | number0–5 ptstep 0.5 | 1 | Size of the title text Sets the title text size from 8 to 24 pt. |
|---|
Emits and receives
What this control sends when you use it, and what it can show or follow when data arrives.
Emits
Emits| Sends | When | Type | What it sends |
|---|
When you choose a colorvalue | change | color | the color you chose, as a hex code The system color sheet sends as you drag through colors, so one visit can send several times; there is no transparency Example: #7F8CFF |
|---|
Receives
Receives| Takes | From | Type | What it does |
|---|
valuefollow | hub, mqtt, http, store, default | color | a color to show on the swatch, as a hex code the swatch changes to it without sending anything; your next choice replaces it Example: #7F8CFF |
|---|
Sample
The placeholder value the editor shows before real data arrives.
Examples
3 examples, each one a control you can paste into a layout.
JSON 8 lines
{
"type": "colorPicker",
"id": "lr-color",
"position": [1, 3],
"defaultValue": "#F4B860",
"label": "Color",
"action": { "method": "meshsocket", "mode": "send", "event": "route_msg_noreply", "payload": { "target_name": "hue-bridge", "type": "color", "payload": { "room": "living", "hex": "{{value}}" } } }
}
Open in CAR-TER ↗
Rendered by the appTap to pick a color, with a short Undo pill after each change.
JSON 8 lines
{
"type": "colorPicker",
"id": "accent-color",
"position": [0, 0],
"label": "Accent",
"defaultValue": "#667EEA",
"confirm": true
}
Open in CAR-TER ↗
A squarer swatch with a thicker outline and larger label.
JSON 8 lines
{
"type": "colorPicker",
"id": "strip-color",
"position": [0, 1],
"label": "Strip",
"defaultValue": "#FF6B6B",
"theme": { "cornerRadius": 4, "borderWidth": 2, "labelFontSize": 16 }
}
Open in CAR-TER ↗
Try it on your phone
carterkit serves a small hub on your computer and pushes one example to CAR-TER on your iPhone or iPad. Pair once with the code it prints.
Install the Python kit.
pip install carterkit
Show “Room light color” on your phone.
carterkit demo colorPicker --example 'Room light color'
Swap in any example name from this page, or leave --example off for the first one.
carterkit quickstart · Get CAR-TER
Behavior
- Shows the iOS system color picker on tap
- Value stored and transmitted as
#RRGGBB hex string
{{value}} in actions is the hex string
Generated from ControlDocs/color-picker.md. Something unclear or missing? Tell me.