Color.contrasted()
Returning the most contrasting color isn't a trivial task, as there are often many possible choices. It's usually best left for the user to implement using a script.