We kept the option interactive=True, so when the value of the meter i.e amountusedvar is changed by mouse, it triggers the function my_upd() by using the trace method.
m1.amountusedvar.trace("w", my_upd) # On change of amountusedvar
Bootstyle parameter to manage colour based on amountused value of a Ttkbootstrap Meter widget #7
Function my_upd()
This function is called when the value or amountusedvar option of the meter is changed. Inside this function we will keep if elif condition checks to set the option bootstyle to different colors. There are 8 different colors are already avilable here is the list.
PRIMARY, SECONDARY, SUCCESS, INFO, WARNING, DANGER, LIGHT, DARK