Extract single color value from RGB using templates

I am wondering if it is possible to use YAML templates to extract a single color value from an RGB setting of a light. I have searched the forum and found great hints on assigning RGB values but I would like to extract a value to use in an IF statement.

If ‘Green’ is > 50 then set white value to 100.

Any hints or suggestions are greatly appreciated. Thank you for your time.

Solved. ‘rgb_color[2]’ is green.