Switch between color/brightness with rotary encoder for Nano (RGB LED Strip)

Im not sure I understand how to toggle the state. I can detect the button change from unpressed to pressed, but i don't know what to write to toggle the function state.