Yelp

(The Help System)

color.rl

Get the relative luminance of a color.

Parameters

color

A color specified in hexidecimal, rgb(), or rgba().

This template calculates the relative luminance of a color, returning a number between 0.0 and 1.0. The relative luminance is used when calculating color contrast. The relative luminance algorithm is defined by the WCAG:

http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef

This template accepts six-digit and three-digit hexidecimal color codes, colors specified with rgb(), and colors specified with rgba(). It does not accept HSL or named HTML colors.

Calls Templates