Skip to content

Commit

Permalink
added test for gl color
Browse files Browse the repository at this point in the history
  • Loading branch information
gka committed Nov 18, 2013
1 parent 75c69a9 commit 1172be8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/colors-test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -63,4 +73,4 @@ vows
topic: chroma.interpolate 'lightyellow', 'navy', 0.5, 'hsl'
'hex': (topic) -> assert.equal topic.hex(), '#31ff98'

.export(module)
.export(module)

0 comments on commit 1172be8

Please sign in to comment.