onPrimary property

Color? onPrimary
final

A color that is clearly legible when drawn on primary color.

To ensure that an app is accessible, a contrast ratio of 4.5:1 for primary and onPrimary is recommended. See www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html.

If null, and if colorScheme.onPrimary is null, the color is derived from the brightness of the effective primary color, and will be be black if it is light and white if it is dark.

Implementation

final Color? onPrimary;