mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 10:16:46 +00:00
Color wheel fixes (#706)
* hide overflow properly * only try to do rgb stuff on init if we have a value * just to be sure
This commit is contained in:
parent
77cc77396b
commit
8dc81b1daa
@ -317,6 +317,9 @@ class HaColorPicker extends window.hassMixins.EventsMixin(Polymer.Element) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
applyRgbColor(rgb) {
|
applyRgbColor(rgb) {
|
||||||
|
if (!rgb) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// do nothing is we already have the same color
|
// do nothing is we already have the same color
|
||||||
if (this.rgbColor &&
|
if (this.rgbColor &&
|
||||||
this.rgbColor.r === rgb.r &&
|
this.rgbColor.r === rgb.r &&
|
||||||
|
@ -34,8 +34,8 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
max-height: 0px;
|
max-height: 0px;
|
||||||
overflow: visible;
|
overflow: hidden;
|
||||||
transition: max-height .2s ease-in;
|
transition: max-height .5s ease-in;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-effect_list .effect_list,
|
.has-effect_list .effect_list,
|
||||||
@ -47,6 +47,7 @@
|
|||||||
|
|
||||||
.has-rgb_color ha-color-picker {
|
.has-rgb_color ha-color-picker {
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
|
overflow: visible;
|
||||||
--ha-color-picker-wheel-borderwidth: 5;
|
--ha-color-picker-wheel-borderwidth: 5;
|
||||||
--ha-color-picker-wheel-bordercolor: white;
|
--ha-color-picker-wheel-bordercolor: white;
|
||||||
--ha-color-picker-wheel-shadow: none;
|
--ha-color-picker-wheel-shadow: none;
|
||||||
@ -159,8 +160,9 @@
|
|||||||
this.brightnessSliderValue = newVal.attributes.brightness;
|
this.brightnessSliderValue = newVal.attributes.brightness;
|
||||||
this.ctSliderValue = newVal.attributes.color_temp;
|
this.ctSliderValue = newVal.attributes.color_temp;
|
||||||
this.wvSliderValue = newVal.attributes.white_value;
|
this.wvSliderValue = newVal.attributes.white_value;
|
||||||
this.colorPickerColor = this.rgbArrToObj(newVal.attributes.rgb_color);
|
if (newVal.attributes.rgb_color) {
|
||||||
|
this.colorPickerColor = this.rgbArrToObj(newVal.attributes.rgb_color);
|
||||||
|
}
|
||||||
if (newVal.attributes.effect_list) {
|
if (newVal.attributes.effect_list) {
|
||||||
this.effectIndex = newVal.attributes.effect_list.indexOf(newVal.attributes.effect);
|
this.effectIndex = newVal.attributes.effect_list.indexOf(newVal.attributes.effect);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user