2 //colors compared with photoshop values.
4 describe('Color constructor, hex', {
6 'before all': function(){
7 myColor = new Color('#a2c240');
10 'should have the correct rgb': function(){
11 value_of(myColor).should_be([162, 194, 64]);
14 'should have the correct hsb': function(){
15 value_of(myColor.hsb).should_be([75, 67, 76]);
18 'should have the correct hex': function(){
19 value_of(myColor.hex).should_be('#a2c240');
24 describe('Color constructor, hsb', {
26 'before all': function(){
27 myColor = new Color('hsb(75, 67, 76)');
30 'should have the correct rgb': function(){
31 value_of(myColor).should_be([161, 194, 64]);
34 'should have the correct hsb': function(){
35 value_of(myColor.hsb).should_be([75, 67, 76]);
38 'should have the correct hex': function(){
39 value_of(myColor.hex).should_be('#a1c240');
44 describe('Color constructor, rgb', {
46 'before all': function(){
47 myColor = new Color('rgb(162, 194, 64)');
50 'should have the correct rgb': function(){
51 value_of(myColor).should_be([162, 194, 64]);
54 'should have the correct hsb': function(){
55 value_of(myColor.hsb).should_be([75, 67, 76]);
58 'should have the correct hex': function(){
59 value_of(myColor.hex).should_be('#a2c240');