Similar Items: A Complexity Dichotomy for Generalized Rainbow Matchings Based on Color Classes