From 579d74ee33b54c1db62d568ef71c7f0028f93ccd Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 13 Nov 2019 06:53:29 -0800 Subject: [PATCH] jsdoc rgbRelativeLuminance2 --- src/browser/Color.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/browser/Color.ts b/src/browser/Color.ts index aaf5ea2ee..d4cbfe0e1 100644 --- a/src/browser/Color.ts +++ b/src/browser/Color.ts @@ -61,6 +61,14 @@ export function rgbRelativeLuminance(rgb: number): number { (rgb ) & 0xFF); } +/** + * Gets the relative luminance of an RGB color, this is useful in determining the contrast ratio + * between two colors. + * @param r The red channel (0x00 to 0xFF). + * @param g The green channel (0x00 to 0xFF). + * @param b The blue channel (0x00 to 0xFF). + * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef + */ export function rgbRelativeLuminance2(r: number, g: number, b: number): number { const rs = r / 255; const gs = g / 255;