Improve dark/light color detection for labels
We currently compute this in Rails in https://gitlab.com/gitlab-org/gitlab/blob/master/app/helpers/labels_helper.rb#L131
We just do a sum of RGB values and treat it as a "light" color if the sum is > 500
@leipert suggested that we should base it on WCAG contrast guidelines. https://github.com/devpuppy/luminosity_contrast might help with this.
Note that we also do this calculation in gitlab-ui
https://gitlab.com/gitlab-org/gitlab-ui/-/blob/master/src/utils/utils.js#L51-68 so we'd need to update both.