Two bilayer metal–organic frameworks based on rare trinuclear Pb/K and Cd/Na clusters have been solvothermally synthesized. They exhibit tunable purple-to-red-to-green and purple-to-green photoluminescence by variation of excitation light, respectively.