Hi guys
Is it possible to customize scene icon color in Picture Glance Card ?
I try that, but it’s not working :
customize.yaml
scene.salon_lampes_random:
icon_color: rgb(6, 16, 204)
lovelace :
- type: picture-glance
title: Cuisine
entities:
- scene.salon_lampes_random
- light.cuisine_plafond
state_image:
"on": /local/img/cuisine_on.png
"off": /local/img/cuisine_off.png
entity: light.cuisine_plafond
Thanks !
petro
(Petro)
April 1, 2019, 12:39pm
3
You have to do it through lovelace with styles. Using the custom card modder card.
1 Like
Hi @petro
I tried with that :
- type: "custom:card-modder"
style:
--paper-item-icon-color: green
border-radius: 5px
color: rgb(0, 0, 100)
card:
type: picture-glance
title: Cuisine
tap_action:
action: toggle
hold_action:
action: more-info
entities:
- scene.cuisine_plafond_tamisee
- scene.cuisine_plafond_forte
- light.cuisine_plafond
state_image:
"on": /local/img/cuisine_on.png
"off": /local/img/cuisine_off.png
entity: light.cuisine_plafond
but css seems to use class with no variable) :
ha-icon.state-on {
color: white;
}
ha-icon {
cursor: pointer;
padding: 8px;
color: #a9a9a9;
}
1 Like
petro
(Petro)
April 3, 2019, 11:36am
5
if it’s ha-icon, then that’s what you want to override. Not 100% sure this will work but it’s worth a shot.
style:
ha-icon-color: rgb(0, 0, 100)
@thomasloven any other suggestions?
1 Like
Good idea, but it does not work …
Try "--iron-icon-fill-color": rgb(0,0,100)
2 Likes
It works, thank you very much !
Is-it possible to have two differents colors, one for ha-icon
and one for ha-icon.state-on
?
I would like to have differents colors for scenes entities and lights entities ?
That’s what I thought, thanks again !
petro
(Petro)
April 3, 2019, 2:51pm
11
You could use the template card to template this color:
Lovelace Templates
I’ve gone and made a crazy card that allows you to pretty much template anything in Lovelace for your card configurations using any information available on the frontend; states, attributes, user, etc.
Want state/attribute-based icons? DONE!
Want dynamic stacks; vertical vs horizontal based on user? DONE!
Want OR conditionals? DONE!
The list is pretty much endless and I’m sure you all will come up with some crazy stuff. Be sure to share.
Go nuts! Enjoy!
xbmcnut
(xbmcnut)
July 3, 2020, 2:21am
12
Could you possibly share your working code? I’m trying to do a similar thing but a bit of a CSS NOOB.
- type: "custom:card-modder"
style:
--iron-icon-fill-color: rgb(0,0,100)
card:
(...)
xbmcnut
(xbmcnut)
July 6, 2020, 10:20pm
14
Thank you! I see my problem though. I’ve been trying to do this in custom:card-mod
instead as I noted that custom:card-modder
had been deprecated.
1 Like
71n0
(Andy)
October 23, 2021, 1:32pm
15
How to get the same with card-mod instead of card modder?
card_mod:
style: |
ha-card {
–iron-icon-fill-color: rgb(255,0,0)
}
does not work for me