Gradient Slider Background.
Grandients made with CSS Gradient
HARD GRADIENT
type: horizontal-stack
cards:
- type: custom:mushroom-number-card
entity: input_number.back_garden_set_moisture
display_mode: slider
name: Back Garden Set Target Moisture Level
card_mod:
style:
mushroom-number-value-control$: |
mushroom-slider {
{% set nbr= states('input_number.back_garden_set_moisture') | float %}
{% if nbr<21 %}
--main-color: #F75050 !important;
--gradient: -webkit-linear-gradient(360deg, rgba(112,7,0,1) 20%, rgba(115,117,0,1) 21%, rgba(115,117,0,1) 40%, rgba(0,97,34,1) 41%, rgba(0,97,34,1) 60%, rgba(0,104,117,1) 61%) !important;
{% elif nbr<41 %}
--main-color: #EEE049 !important;
--gradient: -webkit-linear-gradient(360deg, rgba(112,7,0,1) 20%, rgba(115,117,0,1) 21%, rgba(115,117,0,1) 40%, rgba(0,97,34,1) 41%, rgba(0,97,34,1) 60%, rgba(0,104,117,1) 61%) !important;
{% elif nbr<61 %}
--main-color: #55E84A !important;
--gradient: -webkit-linear-gradient(360deg, rgba(112,7,0,1) 20%, rgba(115,117,0,1) 21%, rgba(115,117,0,1) 40%, rgba(0,97,34,1) 41%, rgba(0,97,34,1) 60%, rgba(0,104,117,1) 61%) !important;
{% elif nbr<100 %}
--main-color: #39BEEA !important;
--gradient: -webkit-linear-gradient(360deg, rgba(112,7,0,1) 20%, rgba(115,117,0,1) 21%, rgba(115,117,0,1) 40%, rgba(0,97,34,1) 41%, rgba(0,97,34,1) 60%, rgba(0,104,117,1) 61%) !important;
{% endif %}
}
SOFT GRADIENT
type: horizontal-stack
cards:
- type: custom:mushroom-number-card
entity: input_number.back_garden_set_moisture
display_mode: slider
name: Back Garden Set Target Moisture Level
card_mod:
style:
mushroom-number-value-control$: |
mushroom-slider {
{% set nbr= states('input_number.back_garden_set_moisture') | float %}
{% if nbr<21 %}
--main-color: #F75050 !important;
--gradient: -webkit-linear-gradient(360deg, rgba(112,7,0,1) 10%, rgba(115,117,0,1) 30%, rgba(0,97,34,1) 50%, rgba(0,104,117,1) 75%) !important;
{% elif nbr<41 %}
--main-color: #EEE049 !important;
--gradient: -webkit-linear-gradient(360deg, rgba(112,7,0,1) 10%, rgba(115,117,0,1) 30%, rgba(0,97,34,1) 50%, rgba(0,104,117,1) 75%) !important;
{% elif nbr<61 %}
--main-color: #55E84A !important;
--gradient: -webkit-linear-gradient(360deg, rgba(112,7,0,1) 10%, rgba(115,117,0,1) 30%, rgba(0,97,34,1) 50%, rgba(0,104,117,1) 75%) !important;
{% elif nbr<100 %}
--main-color: #39BEEA !important;
--gradient: -webkit-linear-gradient(360deg, rgba(112,7,0,1) 10%, rgba(115,117,0,1) 30%, rgba(0,97,34,1) 50%, rgba(0,104,117,1) 75%) !important;
{% endif %}
}