Can I wear black to a wedding?

I’ve heard some people say it’s fine and pretty classy, but some say it’s still considered “bad luck”