schemeColorPair static method

Color schemeColorPair(
  1. SchemeColor value,
  2. ColorScheme colorScheme
)

Returns the Color from passed in ColorScheme in colorScheme that is the "on" color pair corresponding to the SchemeColor enum value passed in via value.

This function is used to get the color value for the color pair to the passed in scheme enum value, thus giving the correct Colorscheme based contrast color for the provided SchemeColor. For example passing in SchemeColor.primary enum value, will return the ColorScheme.onPrimary. Wise versa, passing in SchemeColor.onPrimary will return the color ColorScheme.primary.

Implementation

static Color schemeColorPair(SchemeColor value, ColorScheme colorScheme) =>
    schemeColor(onSchemeColor(value), colorScheme);