Delay on/off

Hi, I am really new to blynk and programming in general. Heres my question, I have a pool light that changes color when the switch is flipped. it takes multiple on/off flips of the switch to achieve a certain color. I have to flip the toggle say 10 times to achieve blue. How could I program something like this?