Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "wordpress-packages/customize/lib/utils/getLuminosityRatio"

Index

Functions

Functions

getLuminosityRatio

  • getLuminosityRatio($color1: string, $color2: string): number
  • Calculate contrast ratio of two given #RRGGBB strings.

    Also ported to ContrastRatioValidator.php.

    see

    http://www.w3.org/TR/WCAG20/#contrast-ratiodef

    Parameters

    • $color1: string
    • $color2: string

    Returns number

Generated using TypeDoc