Skip to content

hd-color-wheel

Live preview

<hd-color-wheel bind="{{ cap.light_hue }}" favourites="none"></hd-color-wheel>

Attributes and example

hd-color-wheel

on change

A light’s colour on a wheel (hue round the edge, saturation from the white middle out) and its whites on a disk from cool at the top to warm at the bottom; a light with both shows Colour and White above it. Bound to the light’s light_hue (or light_temperature for a light with whites only), it reads the light’s saturation, temperature and mode itself, and sends the colour on release (with live also while it is dragged). Below it the account’s favourite colours, up to 15: a tap sets one, + keeps the colour shown, holding one or right-clicking it offers to remove it. On a paired screen or a share link they are shown, not changed. With hue, saturation, temperature and mode and a data-hd-on-change handler, the handler gets { mode: "color", hue, saturation } or { mode: "temperature", temperature }.

AttributeWhat it is
bindThe light, by its colour: {{ settings.light.cap.light_hue }}, or {{ settings.light.cap.light_temperature }} for a light with whites only. Its saturation, temperature and mode are read from the same light.
hueThe explicit form instead of bind: the hue, 0–1.
saturationThe explicit form: the saturation, 0–1.
temperatureThe explicit form: the white, 0 (cool) to 1 (warm); with hue too, both tabs show.
modeThe explicit form: which it shows now, the colour or the white.One of color, temperature.
favouritesnone leaves the favourite colours out, for a small tile.One of shown, none. Default shown.
labelAccessible label; defaults to Colour.
liveSends the colour while it is dragged too, a few times a second, so the lamp follows the finger; without it, once on release.
<hd-color-wheel bind="{{ cap.light_hue }}" favourites="none"></hd-color-wheel>

Styling

Set CSS variables on the component element. Its internal elements live in Shadow DOM; only the exposed named parts can be styled with ::part.

--hd-accent
The theme’s accent: active controls, links, highlights.
--hd-border
Lines round tiles and between parts.
--hd-border-width
How thick borders are.
--hd-danger
Act now: smoke, a leak, an alarm.
--hd-ease-out
The easing of most movement.
--hd-ease-spring
A springy easing, for things that bounce into place.
--hd-focus
The outline round what has keyboard focus.
--hd-font-ui
The font of labels and running text.
--hd-motion-base
An ordinary change, like a value sliding.
--hd-motion-fast
A quick change, like a press. 0ms when nothing may move.
--hd-motion-slow
A slow change, like a theme switching.
--hd-overlay
Menus, dialogs and popups over the page.
--hd-surface
A tile’s colour.
--hd-surface-raised
Something on a tile that stands out from it, like a button.
--hd-text
Text and big numbers.
--hd-text-faint
The quietest text: hints, units, times.
--hd-text-muted
Labels and secondary text.
--hd-track
The empty part of a slider, bar or ring.

Style the host

hd-color-wheel {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables