highContrasted

fun Color.highContrasted(background: Color = Color.Transparent): Color

Returns a high contrasted color for better contrast when high contrast mode is enabled.

When high contrast mode is disabled, the original color is returned unchanged.

Return

OudsTheme.colorScheme.always.black or OudsTheme.colorScheme.always.white color when high contrast mode is enabled, or the original color otherwise.

Parameters

background

The background color on which this color will be displayed. If transparent, the theme's primary background color is used as reference.