tesk9/palette/3.0.1

SolidColor.Accessibility

type Rating
= Inaccessible
| AA
| AAA

Read more about levels of conformance at WCAG.

meetsAA : Rating -> Bool
meetsAAA : Rating -> Bool
{ fontSize : Float
, fontWeight : Int
}
-> Rating

Checks whether two colors have enough contrast with each other to be used together (e.g., as a background and text color combination). Returns the WCAG Rating level.

To meet AA level sufficiently, follow these standards. To meet AAA level sufficiently, follow these standards.

Calculate the contrast between two colors.