diff --git a/src/dialogs/more-info/components/lights/light-color-picker.ts b/src/dialogs/more-info/components/lights/light-color-picker.ts index 4093ef9bd4..20959181b7 100644 --- a/src/dialogs/more-info/components/lights/light-color-picker.ts +++ b/src/dialogs/more-info/components/lights/light-color-picker.ts @@ -1,6 +1,7 @@ import "@material/mwc-button"; import "@material/mwc-tab-bar/mwc-tab-bar"; import "@material/mwc-tab/mwc-tab"; +import { mdiEyedropper } from "@mdi/js"; import { css, CSSResultGroup, @@ -10,7 +11,14 @@ import { PropertyValues, } from "lit"; import { customElement, property, state } from "lit/decorators"; -import { hs2rgb, rgb2hs } from "../../../../common/color/convert-color"; +import { + hex2rgb, + hs2rgb, + hsv2rgb, + rgb2hex, + rgb2hs, + rgb2hsv, +} from "../../../../common/color/convert-color"; import { fireEvent } from "../../../../common/dom/fire_event"; import { throttle } from "../../../../common/util/throttle"; import "../../../../components/ha-button-toggle-group"; @@ -27,6 +35,7 @@ import { lightSupportsColorMode, } from "../../../../data/light"; import { HomeAssistant } from "../../../../types"; +import "../../../../components/ha-icon"; export type LightPickerMode = "color_temp" | "color"; @@ -80,6 +89,16 @@ class LightColorPicker extends LitElement { !supportsRgbww && lightSupportsColorMode(this.stateObj, LightColorMode.RGBW); + const hexValue = this._hsPickerValue + ? rgb2hex( + hsv2rgb([ + this._hsPickerValue[0], + this._hsPickerValue[1], + ((this._colorBrightnessSliderValue ?? 100) / 100) * 255, + ]) + ) + : ""; + return html` ${this._modes.length > 1 ? html` @@ -116,27 +135,37 @@ class LightColorPicker extends LitElement { : nothing} ${this._mode === "color" ? html` - - +
+ + + +
${supportsRgbw || supportsRgbww ? html`