Templating question, bulb color change using switch

First of all, sorry for possible spelling errors, english is not my first language :sweat_smile: Hopefully this is in correct category.

I already have working light switch which you can use to change bulb colors using the following template:

{{ (30 + (state_attr('light.tradfri_makuuhuone_lamppu_1', 'hs_color')[0] or 0)) % 360 }}

It circles around the color wheel just like it should be, but no matter what math compilation I try, I just can’t get it to circle counter clockwise. My math skills just are not enough to solve this on my own.

I have TrÄdfri switch with left & right switches and would like it to circle clockwise when pressed right (Which works fine) and counter clockwise when pressed left (No clue how to get it work).

Bump.
Still trying to figure it out. Without success lol.
If I try to replace “+” with “-”, it will just loop between two colors.

Never mind, got it working. If anyone else find this useful, try below;

{{ (state_attr(‘light.office’, ‘hs_color’)[0]) - 30 }}