We have synthesized a thiophene hydrazone (receptor 1) that acts as a colorimetric receptor showing a reversible color switching (ON and OFF) function induced by anion and cation recognition. This remarkable color switching is based on two-input complementary IMP/INH logic functions. The (ON and OFF) process of this molecular switch is triggered by an anion (CH3COO−, C6H5COO−, HCOO−, H2PO4− or F−), while it is quenched by any one MII ion of 3d (d5–d10) as well as CdII and HgII. A DMSO solution of receptor 1 underwent a bathochromic shift from 407 to 505 nm upon adding any one of the above-mentioned anions, while switch OFF was achieved by the addition of any one of the above-mentioned cations to regenerate a band at 407 nm.