Change color of input boolean button by other device

Is it possible to change the color of an input boolean button if another device has turned on? I do not want to activate this input boolean only want to change the color and when I activate the boolean button then it also has to have this same color.
And after the other device or this boolean has been toggled then the color has to turn off.