Detect when a beacon changes color?

I'm making a map where you have to "capture" all the beacons by changing their color. Is there any way (in single player vanilla Minecraft) to detect when a beacon color is changed? I was thinking of maybe using observers, but those would only detect if any block was placed there.


Solution 1:

~~~/testforblock(s) You may use this when using /execute

Summon an invisible Armor_Stand (with the name 'Beacon') inside the beacon and then do a sort of '/execute @e[type=Armor_Stand,name=Beacon] ~ ~ ~ /testforblocks XXX' to test if a block changed