Beispiel #1
0
 'should be equal to RGB(R=0; G=23/255; B=42/255; ALPHA=1)': function(color) {
   assert.colorEqual( color,
                      Color({ red: 0,
                              green: 23/255,
                              blue: 42/255,
                              alpha: 1 }) );
 },
Beispiel #2
0
 'should be equal to RGB(R=0; G=0.09; B=0.16; ALPHA=1)': function(color) {
   assert.colorEqual(color,
                     Color({ red: 0,
                             green: .09,
                             blue: .16,
                             alpha: 1 }) );
 },
Beispiel #3
0
 'should be equal to RGB(R=1; G=0: B=0; ALPHA=0.45)': function (color) {
   assert.colorEqual(color,
                     Color({ red: 1,
                             green: 0,
                             blue: 0,
                             alpha: .45 }) );
 }
Beispiel #4
0
 'should be equal to RGB(R=240/255; G=240/255; B=0; ALPHA=1)': function(color) {
   assert.colorEqual( color,
                      Color({ red: 240/255,
                              green: 240/255,
                              blue: 0,
                              alpha: 1 }) );
 }
Beispiel #5
0
 'should be equal to HSL(H=203; S=0.5; L=40%; ALPHA=1)': function(color) {
   assert.colorEqual( color,
                      Color({ hue: 203,
                              saturation: .5,
                              lightness: .4,
                              alpha: 1 }));
 },
Beispiel #6
0
 'should be equal to \'rgba(0%,9%,16%,1)\'': function(color) {
   assert.colorEqual(color,
                     Color('rgba(0%,9%,16%,1)'));
 }
Beispiel #7
0
 'hue shifted by 359 degrees should be equal to HSV(H=89; S=0.5; V=0.5)': function(color) {
   assert.colorEqual( color.shiftHue(359),
                      Color({ hue: 89,
                              saturation: .5,
                              value: .5 }) );
 }
Beispiel #8
0
 'desaturated by -2.3 should be equal to HSV(H=90; S=1; V=0.5)': function(color) {
   assert.colorEqual( color.desaturateByAmount(-2.3),
                      Color({ hue: 90,
                              saturation: 1,
                              value: .5 }) );
 },
Beispiel #9
0
 'should be equal to `Color(\'#8FBC8F\')`': function(color) {
   assert.colorEqual(color, Color('#8FBC8F'));
 },
Beispiel #10
0
 'saturated by -0.1 should be equal to HSV(H=90; S=0.4; V=0.5)': function(color) {
   assert.colorEqual( color.saturateByAmount(-.1),
                      Color({ hue: 90,
                              saturation: .4,
                              value: .5 }) );
 },
Beispiel #11
0
 'saturated by 2% should be equal to HSV(H=90; S=0.51; V=0.5)': function(color) {
   assert.colorEqual( color.saturateByRatio(.02),
                      Color({ hue: 90,
                              saturation: .51,
                              value: .5 }) );
 },
Beispiel #12
0
 'devalue by 2.3 should be equal to HSV(H=90; S=0.5; V=0)': function(color) {
   assert.colorEqual( color.devalueByAmount(2.3),
                      Color({ hue: 90,
                              saturation: .5,
                              value: 0 }) );
 },
Beispiel #13
0
 'increase value by 0.1 should be equal to HSV(H=90; S=0.5; V=0.6)': function(color) {
   assert.colorEqual( color.valueByAmount(.1),
                      Color({ hue: 90,
                              saturation: .5,
                              value: .6 }) );
 },
Beispiel #14
0
 'increase value by 1000% should be equal to HSV(H=90; S=0.5; V=1)': function(color) {
   assert.colorEqual( color.valueByRatio(10), 
                      Color({ hue: 90,
                              saturation: .5,
                              value: 1 }));
 },
Beispiel #15
0
 'should be RGB(R=0; G=1; B=0) (cyan)': function(color) {
   assert.colorEqual( color,
                      Color({ red: 0,
                              green: 1,
                              blue: 1 }) );
 }
Beispiel #16
0
 'should result in RGB (R=0; G=0.4; B=0.6)': function(color) {
   assert.colorEqual(color, Color({ red: 0,
                                    green: .4,
                                    blue: .6 }));
 }
Beispiel #17
0
 'desaturated by 50% should be equal to HSV(H=90; S=0.25; V=0.5)': function(color) {
   assert.colorEqual( color.desaturateByRatio(.5),
                      Color({ hue: 90,
                              saturation: .25,
                              value: .5 }) );
 },
Beispiel #18
0
 'should be equal to \'hsla(563, 50%, 40%, 2)\'': function(color) {
   assert.colorEqual( color,
                      Color('hsla(563, 50%, 40%, 2)'));
 }