Visual and reversible carbon dioxide sensing enabled by doctor blade coated macroporous photonic crystals.