A toggle button can be created using a label and controlling its visible properties based on a value.
The visible properties of a toggle button needs to be considered carefully. Should the button show its current state or should it show the state it will assume if pressed?
Industrial screen based process control systems I have seen show the state it will assume if pressed. That means it will normally show its opposite state. An example is a button which opens or closes something. It the button shows OPEN then the device it controls is actually closed and will be opened if the button is pressed.
In the case of Yes = green and No= red then Yes would indicate that the current condition is No but the button’s colour would be green. It needs to be made clear to the user if the button is used to control something or indicate its current state.
An option group may be a better choice.
Chris.