highContrast method

RgbColour highContrast(
  1. List<RgbColour> suggestions
)

Implementation

RgbColour highContrast(List<RgbColour> suggestions)
{
  List<RgbColour> suggestionsList = new List.from(suggestions);

  if (suggestionsList.length == 0) {
    throw new IllegalArgumentException("No color suggestions in list.");
  }

  suggestionsList.sort( new _RgbColourContrastComparator(this).compare );

  return suggestionsList[0];
}