Optical Gating of Photoluminescence from Color Centers in Hexagonal Boron Nitride