From 1172be8b7194e145a4e0b35ea4974db297e9c604 Mon Sep 17 00:00:00 2001 From: Gregor Aisch Date: Mon, 18 Nov 2013 11:54:52 +0100 Subject: [PATCH] added test for gl color --- test/colors-test.coffee | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/colors-test.coffee b/test/colors-test.coffee index 34482d6c..f74dc03e 100644 --- a/test/colors-test.coffee +++ b/test/colors-test.coffee @@ -26,6 +26,16 @@ vows 'hex': (topic) -> assert.equal topic.hex(), '#ff0000' 'rgb': (topic) -> assert.deepEqual topic.rgb(), [255,0,0] + 'gl color': + topic: chroma.gl 1,0,0 + 'name': (topic) -> assert.equal topic.name(), 'red' + 'hex': (topic) -> assert.equal topic.hex(), '#ff0000' + 'rgb': (topic) -> assert.deepEqual topic.rgb(), [255,0,0] + + 'gl color w/ alpha': + topic: chroma.gl 0,0,1,0.5 + 'rgba': (topic) -> assert.deepEqual topic.rgba(), [0,0,255,0.5] + 'modify colors': topic: chroma 'F00' 'darken': (topic) -> assert.equal topic.darken(10).hex(), '#dd0000' @@ -63,4 +73,4 @@ vows topic: chroma.interpolate 'lightyellow', 'navy', 0.5, 'hsl' 'hex': (topic) -> assert.equal topic.hex(), '#31ff98' - .export(module) \ No newline at end of file + .export(module)