I want to apply formatting according to my field value if value in selection field is 'open', 'pending' and 'solved' colors should be 'red', 'blue' and 'grey' respectively.
<field name = 'status' widget="selection" attrs="{'invisible':[('type','=','open')]}" style="color:red;" />
<field name = 'status' widget="selection" decoration-danger="status=='open'" decoration-info="status=='pending'" decoration-muted="status=='solved'"/>
It is working for me.