2022-03-28 6:27 AM
2022-04-06 12:21 AM
Hello @Community member ,
I'm not sure to understand what you mean with "Flash the colors".
Can you please elaborate ?
Thanks,
/Yoann
2022-04-10 6:09 AM
Hello @Yoann KLEIN
thank you for your return, I want to make the color of a block flashes for a specific duration.
I don't know if it's possible !
Thanks,
2022-04-11 4:48 AM
Hello,
There is a very easy way to do that :
counter++;
 
if(counter%60 == 0) //  toggle color every second
{
	toggle = !toggle;
 
	switch(toggle)
	{
	case false:
	box2.setColor(red);
	break;
 
	case true:
	box2.setColor(blue);
	break;
	}
 
	box2.invalidate();
	counter=0;
}Please note that you can change the blinking rhythm by modifying the "if(counter%60 == 0) " condition (For example : "if(counter%30 == 0)" will enable you to change the color every half second).
Let me know if that helped,
/Yoann