<kern-color-picker>
Colour field for smart-home lights, form-associated. mode="color": value is #rrggbb; the popover has a saturation/brightness area, a hue bar and swatches. mode="temperature": value is a colour temperature in Kelvin (min-kelvin–max-kelvin) on a warm-to-cold bar. The hex or Kelvin text can be typed (Enter or leaving applies it). Area and bars work with pointer and keys (Arrows, Shift = larger steps, Home/End on bars).
Examples
Light colour
mode="color" (default): value is #rrggbb. The popover has a saturation/brightness area, a hue bar and swatches. The hex text can be typed (Enter or leaving applies it). Area and bar work with the arrow keys; Shift takes larger steps.
Color temperature
mode="temperature": value is a colour temperature in Kelvin between min-kelvin and max-kelvin on a warm-to-cold bar, in steps of kelvin-step. Swatches are Kelvin values.
Properties
ariaLabelTextstring | undefined
Accessible name when there is no visible label.
disabledboolean
errorstring | undefined
hintstring | undefined
kelvinStepnumber
labelstring | undefined
labelAreastring | undefined
labelHuestring | undefined
labelInvalidstring | undefined
labelOpenstring | undefined
labelTemperaturestring | undefined
maxKelvinnumber
minKelvinnumber
mode"color" | "temperature"
namestring | undefined
noImplicitSubmitboolean
Enter does not submit the surrounding form.
readonlyboolean
requiredboolean
size"md" | "sm"
swatchesstring | string[]
Presets: hex colours, or Kelvin values with mode="temperature", e.g. #ff8a3c,#3cc8cc or 2700,4000,6500.
valuenumber | string
#rrggbb, or Kelvin with mode="temperature".
Events
kernChangeCustomEvent<{ value: string | number; }>
When a colour is applied (drag end, key, swatch, typed text).
kernInputCustomEvent<{ value: string | number; }>
While dragging or stepping.
Methods
hide()hide() => Promise<void>
Closes the colour panel.
show()show() => Promise<void>
Opens the colour panel.
CSS parts
controlThe field box
panelThe popover