Color centers, arising from zero-dimensional defects, exploit quantum confinement to access internal electron quantum degrees of freedom, holding potential for quantum technologies. Despite intensive research, the structural origin of many color centers remains elusive. In this study, we employ in-situ cathodoluminescence scanning transmission electron microscopy combined with integrated differential phase contrast imaging to examine how defect configuration in tungsten sulfide determines color-center emission. Using an 80-kV accelerated electron beam, defects were deliberately produced, visualized, excited in situ and characterized in real time in monolayer WS2 within hBN|WS2 | hBN heterostructures at 100 K. These color centers were simultaneously measured by cathodoluminescence microscopy and differentiated by machine learning. Supported by DFT calculations, our results identified a crucial sulfur vacancy configuration organized into featured vacancy pairs, generating stable and bright luminescence at 660 nm. These findings elucidate the atomic-level structure-exciton relationship of color centers, advancing our understanding and quantum applications of defects in 2D materials.