I have a progress bar and having been try to program so that at 100%
0 - 50 is colour green
50 - 70 is colour yellow
70 - 100 is colour red
Is there an easy method, or will it involve the use of draw.
Thanks
Progress bar with different colours
-
- User
- Posts: 27
- Joined: Sun Jul 13, 2008 9:47 am
- Location: UK
Code: Select all
OpenWindow(0,0,0,200,100,"",$ca0001)
CreateGadgetList(WindowID(0))
ProgressBarGadget(1,10,40,180,20,0,100)
SetGadgetColor(1,#PB_Gadget_FrontColor,RGB(0,$ff,0))
For n=0 To 100
If n>49
SetGadgetColor(1,#PB_Gadget_FrontColor,RGB($ff,$ff,0))
EndIf
If n>69
SetGadgetColor(1,#PB_Gadget_FrontColor,RGB($ff,0,0))
EndIf
SetGadgetState(1,n)
Delay(50)
WindowEvent()
Next
MessageRequester("","")
Or did you mean that you want a bar that is actually all three colours at once? (Which after re-reading your post is what I think you want)