The Sin (Sine) formula calculates the radian equivalent of its subject value which always returns a value between -1 and 1, the subject in this case is the simple counter on the previous line. Much more detail on how the Sin formula works available in the earlier post – Button Animation with CSS
The result is multiplied by 255. Then 765 is added and then the result is divided by 4 (which changes the range so the value oscillates between 128 and 255)
The Round formula then rounds the value to the nearest whole number removing the decimals and the result is applied to the variable varGreen
Every 50 milliseconds, the value of varCounter increments by one and a new value for varGreen is calculated
We now overlay a button on top of the HTML box and ensure the size including the four BorderRadius properties matches the HTML text box exactly. Make the button Fill transparent and the BorderColor black. Assign the Color property (the color of the button text) to be RGBA(255,varGreen,0,1. And finally make the HoverColor to be white
Run the app and manually start the timer and the result is shown below