Skip to content

preferLightText

preferLightText(bg): boolean

Defined in: packages/math-color/src/encoding/rgb8/accessibility/prefer-light-text.ts:11

Returns true if white foreground text achieves higher absolute APCA Lc contrast against bg than black foreground text.

Use this to choose between light and dark text overlaid on a background color.

Rgb8

boolean