Skip to main content
Module

x/a11y_color_contrast/apca_tables.ts>apcaValidateFont

A TypeScript package to calculate WCAG 2.0/3.0 and APCA color contrasts
Latest
function apcaValidateFont
import { apcaValidateFont } from "https://deno.land/x/a11y_color_contrast@v0.2.0/apca_tables.ts";

With a given Lc value, a list or a specific font size and if desired the font weights considered, does the Lc value satisfy the required minimum Lc value for the font.

For example. If we have a fontsize of 16px, and want to know if it passes the required Lc value for a weight of 400 with a found Lc value of 94.90 you'd call

import { apcaValidateFont } from "./apca_tables.ts";

apcaValidateFont(94.90, 16, 400)
// > { "16": { "400": true } }

and see that for this combination is passes the required minimum.

Parameters

apca: number
sizes: FontSize | Array<FontSize>
optional
weights: FontWeight | ReadonlyArray<FontWeight>