Kaizen
Browse modulesQR codeqr-code/sharedFunctions

Function: assertQrCodePaint()

function assertQrCodePaint(
   moduleColor: string, 
   backgroundColor: string, 
   minContrastRatio: number
): void;

Defined in: shared/qr-code/svg.ts:92

Enforce the three paint invariants a scannable symbol depends on:

  1. Both paints resolve to a concrete sRGB value, so contrast is checkable.
  2. Both are fully opaque — see-through paint composites the host surface into the symbol.
  3. They are far enough apart for a scanner's thresholding pass to work.

Shared by renderQrCodeMatrixSvg and the UDS QRCode component so the two rendering surfaces cannot drift on the guarantee.

Parameters

ParameterType
moduleColorstring
backgroundColorstring
minContrastRationumber

Returns

void

On this page