@yamlresume/core
    Preparing search index...

    Function getContrastRatio

    • Calculate the WCAG contrast ratio between two colors.

      Parameters

      • hex1: string

        The first color hex string (6 characters, without #).

      • hex2: string

        The second color hex string (6 characters, without #).

      Returns number

      The contrast ratio, between 1 (no contrast) and 21 (black on white).