Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use the icon color in other options? #900

Open
Wolly300 opened this issue Jan 11, 2025 · 3 comments
Open

How to use the icon color in other options? #900

Wolly300 opened this issue Jan 11, 2025 · 3 comments
Labels
FR Feature Request

Comments

@Wolly300
Copy link

Wolly300 commented Jan 11, 2025

Hello together,

I could not figure out if this is already implemented or not, at least I cannot set it up.

image

I want to design the button-card the same way as the default tiles and already used the mushroom repo as a base.

What is missing, right now, is the color icon background. I want to set up the template in a way, it automatically grabs the icon color and uses it with 50% density for the img_cell background-color.

Right now, I'm setting the background-color this way.

styles:
  img_cell:
    - background-color: rgba(255,255,255, 0.5)
  icon:
    - color: rgb(255,255,255)

In the future, I just want to set the icon color like color: green and the background color will be calculated automatically.

@Wolly300 Wolly300 added the FR Feature Request label Jan 11, 2025
@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Jan 11, 2025

so just add a configuration template and be done with it?

you can probably also use (--var-button-card-light-color) to grab that automatically

styles:
  card:
    - background: >
        [[[ return 'rgb(from var(--button-card-light-color) r g b / 1)'; ]]]

or things like

type: custom:button-card
entity: light.your_light
color: auto-no-temperature
styles:
  img_cell:
    - background: |
        [[[ return 'rgb(from var(--button-card-light-color) r g b / 25%)'; ]]]

@Wolly300
Copy link
Author

so just add a configuration template and be done with it?

you can probably also use (--var-button-color) to grab that automatically

Yes, that's the plan with the template, I just don't know, how I can access the color.

This also seems not to work.

image

@Mariusthvdb
Copy link
Contributor

Ok, great.
so close this FR, and hop over to the button-card community thread.

Github really is for issues, or requests that are not yet available ;-)

w're there to help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FR Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants