tesk9/palette/2.0.0

NOTE: the latest version is 3.0.1

Color.Accessibility

type Rating
= Inaccessible
| AA
| AAA

Read more about levels of conformance at WCAG.

meetsAA : Rating -> Bool
meetsAAA : Rating -> Bool
{ fontSize : Float
, fontWeight : Int
}
-> Color
-> Color
-> 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.

contrast : Color -> Color -> Float

Calculate the contrast between two colors.