how can i make countdown timer text color to red when reaches zero?
Code: Select all
;On-screen display (OSD)
CustomColor = 99AA55 ; Can be any RGB color (it will be made transparent below).
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
Gui, Color, %CustomColor%
Gui, Font, s45 ; Set a large font size (32-point).
Gui, Add, Text, vMyText cBlue, 00 ; 00 serve to auto-size the window.
WinSet, TransColor, %CustomColor% ; Make all pixels of this color transparent
Gui, Show, x800 y200 NoActivate ; NoActivate avoids deactivating the currently active window.
return
~f3:: ; hotkey will start or reset counting
counter:=0
SetTimer, UpdateOSD, -10 ; to update immediately
SetTimer, UpdateOSD, 1000
return
UpdateOSD:
counter++
time_display:=6-counter ; 6 and not 5 because counter starts with 1
if (time_display=0)
SetTimer, UpdateOSD, off ; stops the counter
GuiControl,, MyText, %time_display%
return
esc::exitapp