Visible and near-infrared electronic transitions in NCl and NBr