A dinitrophenyl hydrazone colorimetric anion sensor (receptor 1) was synthesized and its recognition properties towards various anions were investigated by naked eye observation and spectroscopic methods, namely UV-vis and 1H NMR titrations in DMSO. The addition of AcO−, F− and H2PO4− to receptor 1 resulted in marked red shift of the charge-transfer absorbance band (Δλ=91 nm, 407 nm to 498 nm) concomitant with a 'naked-eye' detectable colour change from yellow to pink. However, both the colour and spectral changes were reversible by the addition of cations (MII) of 3d5-10 as well as CdII, HgII, MgII and CaII. Subsequently, complementary IMP/INH logic functions based on colour and spectral switching (ON/OFF) were affirmed. The sensor can, thus be utilized as a colorimetric molecular switch modulated by F−/MII.