HatangContrast
object HatangContrast
WCAG colour maths on packed ARGB ints (no Android or Compose types, so it is unit-testable on the JVM). Ported from the Flutter SDK's HatangChatTheme helpers.
Functions
Link copied to clipboard
Link copied to clipboard
WCAG 2 contrast ratio between two opaque colours (1 to 21).
Link copied to clipboard
Near-black or white, whichever reads better on c (a mid blue such as #0ea5e9 gets dark text).
Link copied to clipboard
c moved towards black or white in 5 % steps until it reaches ratio against every colour in backgrounds (opaque; blend translucent tints with alphaBlend first).