Picture Elements CSS Filters Templates

I’m using a Picture Elements card and have an image I want to saturate depending on the brightness level of a light.
I have tried this but doesn’t work, is it even possible ?
If I replace the template with a number between 0 and 1 it works fine.
The template works in the Template Editor.

filter: saturate( {{ states.light.front_garden.attributes.brightness/255 }} )

I’ve also tried but still no go:

brightness( {{(state_attr('light.office_ceiling_light', 'brightness') /254) | round(1)}} )

Is it possible to add templates to CSS filters ?

did you find a way.
i tried using css styles at the top of the picture-element, which works fine for color settings but i cant find a way to set saturate and opacity with a dynamic value