hasSufficientContrast

fun hasSufficientContrast(color1: Color, color2: Color, minimumRatio: Double = 4.5): Boolean

Checks if two colors have sufficient contrast for accessibility.

Return

true if the contrast is sufficient, false otherwise

Parameters

color1

First color

color2

Second color

minimumRatio

Minimum contrast ratio required (default: 4.5 for normal text)