OtpContrast
WCAG contrast checks shared by the Android and iOS components.
Colors are opaque sRGB values in 0xRRGGBB form. Platforms skip translucent colors, because their contrast depends on what is drawn behind them.
Functions
Link copied to clipboard
fun warning(owner: String, foregroundName: String, foregroundRgb: Int, backgroundName: String, backgroundRgb: Int, requirement: OtpContrastRequirement): String?
Returns a warning that explains which pair fails and why, or null when the pair meets requirement. The library logs it and still uses the colors, so brand colors remain usable.