Stimuli-responsive self-assembly of a naphthalene diimide by orthogonal hydrogen bonding and its coassembly with a pyrene derivative by a pseudo-intramolecular charge-transfer interaction.