A color coded bead for use in a microarray for detecting target analytes, the bead comprising: a photochromic compound in a medium, the bead having a receptor molecule on its surface; wherein the photochromic compound confers on the bead a distinct optical signature; and wherein the receptor molecule is capable of binding to a target analyte.