Programming the shape-shifting of flat soft matter