Add the options dark_mode_filter and dark_mode_image to the picture elements card#7304
Add the options dark_mode_filter and dark_mode_image to the picture elements card#7304zsarnett merged 2 commits intohome-assistant:devfrom Santobert:invert_picture_with_dark_mode
Conversation
|
I'd rather allow people to set styles or a different image based on whether it is in dark mode. Inverting the image will not work in all use cases. |
What would you suggest? Something like the following? I'd default to the Another option would be to allow filters that are only applied when the dark mode is enabled. What do you prefer? |
|
Something like https://www.home-assistant.io/lovelace/picture-entity/#state_image So I would say both? |
Done. What do you think? |
|
Looks good, I'm missing a should update in these files, I think the performance is not optimal. But that is something for another PR. |
|
Is there anything else I have to do to get this merged? Or does it just need a little more patience? No hurry, if it is the latter 🤷 |
Proposed change
Allows to enable different filters, depending on whether the dark mode is activated or not. You can also use a completely different image.
This makes the icons better visible and the background colors are more eye-friendly. In addition, you can now read white text like the one below the badge.
Before
After
This is necessary when different devices use different color schemes. For example, my smartphone uses dark mode by default, while the computer usually uses light mode.
This also works combined with
state_filtersince we stack filters inhui-image.ts.I am not really happy with the name of the option. Suggestions are welcome!
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: