Hi Rusell,
I’m trying to build a colour picker inside love lace. I’m using the following to create the card.
cards:
- type: entities
entities:
- type: "custom:slider-entity-row"
entity: input_number.input_color
full_row: true
hide_state: true
attribute: hue
style: |
ha-card {
background: linear-gradient(to right, rgb(255,0,0) 0%, rgb(255,255,0) 16.6%, rgb(0,255,0) 33.2%, rgb(0,255,255) 49.8%, rgb(0,0,255) 66.4%, rgb(255,0,255) 83%, rgb(255,0,0) 100%);
}
Result

Now I want the icon associated with the colour picker to take the same colour and the light itself to take on the colour.
the logic is something like the following
if (states["input_number.input_color"].state <= 16.6)
return "rgb(255, states["input_number.input_color"].state/16.6*255, 0)";
else if (states["input_number.input_color"].state <= 33.2)
return "rgb(255- (states["input_number.input_color"].state-16.6)/16.6*255, 255, 0)";
else if (states["input_number.input_color"].state <= 49.8)
return "rgb(0, 255, (states["input_number.input_color"].state-33.2)/16.6*255)";
else if (states["input_number.input_color"].state <= 66.4)
return "rgb(0, 255- (states["input_number.input_color"].state-49.8)/16.6*255, 255)";
else if (states["input_number.input_color"].state <= 83)
return "rgb((states["input_number.input_color"].state-49.8)/16.6*255, 0, 255)";
else
return "rgb(255, 0, 255- (states["input_number.input_color"].state-83)/16.6*255)";
Any ideas ?