From 476687b6430f3e2c6bda313abc40c9e30ded93b9 Mon Sep 17 00:00:00 2001 From: Gregor Aisch Date: Wed, 28 Aug 2013 14:25:28 +0200 Subject: [PATCH] added chroma.luminance() shortcut --- src/color.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/color.coffee b/src/color.coffee index e148732b..2be2fb97 100644 --- a/src/color.coffee +++ b/src/color.coffee @@ -555,3 +555,5 @@ chroma.contrast = (a, b) -> l2 = b.luminance() if l1 > l2 then (l1 + 0.05) / (l2 + 0.05) else (l2 + 0.05) / (l1 + 0.05) +chroma.luminance = (color) -> + chroma.color(color).luminance()