onColor property
This getter returns appropriate contrast color based on a given color. It will return a color chosen according to the brightness of this color.
- The Color instance on which this getter is called is used to determine the brightness based on ThemeData.estimateBrightnessForColor method.
- If the estimated brightness is light, it will return a color ZetaColorBase.cool.shade90.
- If the estimated brightness is not light (meaning it's dark), it will return ZetaColorBase.white.
Implementation
Color get onColor => isLight ? ZetaColorBase.cool.shade90 : ZetaColorBase.white;