tesk9 / palette / SolidColor.Accessibility


type Rating
    = Inaccessible
    | AA
    | AAA

Read more about levels of conformance at WCAG.

meetsAA : Rating -> Basics.Bool

meetsAAA : Rating -> Basics.Bool

checkContrast : { fontSize : Basics.Float, fontWeight : Basics.Int } -> SolidColor -> SolidColor -> 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 : SolidColor -> SolidColor -> Basics.Float

Calculate the contrast between two colors.