Improved algorithm for displaying white text v. black text

Scrivener automatically chooses to display either white text or black text for the Binder, Synopses, Light mode editors, and a few other places in the UI, based on the darkness or lightness of the field’s background. The algorithm is very good for desaturated backgrounds—white, black, greyscale, the creams and dark cyans of the Solarized palette, and so forth. It gives predictable, expected results for such backgrounds, switching from white to black when the brightness of the background increases past 50%.

This algorithm is not very good at choosing the appropriate text colour if the background is a more saturated colour. In particular, almost illegible results happen when printing index cards with titles highlighted by label colour, if the label in question is a blue or purple based colour—the algorithm overestimates the lightness of the colour, resulting in black text on a dark background. (See the screenshots below: the label colours are the Solarized accent colours, showing the inappropriate use of white text on the Yellow background and black text on a Blue or Violet background.)

I would like to suggest that L&L consider finding an improved algorithm that considers the true luminance of more saturated coloured backgrounds. Thanks in advance for your consideration.