[custom:button-card] setting rgb attributes to background-color

Hi Everyone!

I’m a bit new to YAML and still figuring it out.
I’m trying to set a background-color with rgb attributes of current light
AFAIK, background-color can recieve rgb in this format only:

background-color: rgb(255,0,0)

i try something like this:

background-color: rgb( {{ 
states.light.somelight.attributes.rgb_color[0] | int }} , {{ 
states.light.somelight.attributes.rgb_color[1] | int }} , {{ 
states.light.somelight.attributes.rgb_color[2] | int }} )

but with no success…
can anyone point me to a solution? ive been searching non-stop with no success

No need to post same in two threads))
Answered in the 1st place

Also - a code should be placed in triple “`” (a keyboard button right below “ESC”).
Or use a “preformatted text” button.