Basically yeah, it take legislation. Like the Civil rights act immediately struck down all of the racist covenants (that still exist but are unenforceable).
So maybe a municipal action could do something similar?
Of course the easiest way to not deal with covenants like this is don't buy property with them. Condos have tons and I will never live in one.