Skip to main content

Contrast

AMA performs a contrast check between the component background and its children for tappable elements like Pressable, Button, etc. The check is performed on the component children and sub children up to a depth level of 5.

The minimum contrast ratio expected is at least 4.5:1, and by default, this is a mandatory requirement. While the enhanced contrast of at least 7:1 is a suggestion and therefore prints only a warning if it fails.

tip

Both Log level type and max depth level can be customised, here for more info

AMA dev runtime errors

CONTRAST_FAILED MUST

This error is used when the contrast check between a component background and its children foreground one fails to reach the AA accessibility level.

CONTRAST_FAILED_AAA SHOULD_NOT

This code is used when the contrast check does not pass the AAA level.