looking for a way a to get the rgb values from a color name or theme variable, so I can set that, and use in rgb() And rgba() functions. We can use the rgb(from COLOR R G B /A ) function, but that does result in a final rgb(r,g,b) and not in the for me required r,g,b...real life example:
card_mod:
style: |
hui-generic-entity-row {
background:
{% set perc = states(config.entity)|float(0) %}
/*{% set rest = 100 - perc %}*/
{% set bar = '0,0,0' %}
/*linear-gradient(to left,ivory {{rest}}%, {{bar}} {{perc}}%);*/
linear-gradient(to right, rgb({{bar}}) 0%, rgb({{bar}}) {{perc}}%,
rgba({{bar}},0.6) {{perc}}%, rgba({{bar}},0.2) 100%);
}
which as you can see sets the r,g,b hard coded to '0,0,0' and next uses it in the linear-gradient. My hope is to replace the '0,0,0' with the var(--badge-color) so I can do this https://community.home-assistant.io/t/new-badges-and-card-mod-customisation/757488/69?u=mariusthvdb
thans for any css trickery you can help me with, or jinja for that matter.
should have mentioned I am running card_mod 3.5.0, so dont need the mod-card. Everyone should still be using 3.4.4 now, and require the mod-card to modify badges. the modification itself should be valid for 3.4.4 too… also, I did quickly try to get the rgb() colors from the badge color (and prevent the hard-coded rgb there) using the relative...