1 if(!dojo._hasResource["dojox.color.tests.Generator"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2 dojo._hasResource["dojox.color.tests.Generator"] = true;
3 dojo.provide("dojox.color.tests.Generator");
4 dojo.require("dojox.color.Generator");
6 tests.register("dojox.color.tests.Generator", [
7 function testAnalogous(t){
9 var args={ base: new dojox.color.Color({ r:128, g:0, b:0 }) };
10 var a=dojox.color.Generator.analogous(args);
11 var s='<h3>dojox.color.Generator.analogous</h3><table cellpadding="0" cellspacing="1" border="0"><tr>';
13 dojo.forEach(a, function(item){
14 if(c++%cols==0){ s+="</tr><tr>"; }
15 s+='<td width="32" bgcolor="'+item.toHex()+'"> </td>';
19 s+='<td width="32"> </td>';
22 t.debug(s+'</tr></table>');
25 function testMonochromatic(t){
27 var a=dojox.color.Generator.monochromatic({ base:new dojox.color.Color({r:128, g:0, b:0}) });
28 var s='<h3>dojox.color.Generator.monochromatic</h3><table cellpadding="0" cellspacing="1" border="0"><tr>';
30 dojo.forEach(a, function(item){
31 if(c++%cols==0){ s+="</tr><tr>"; }
32 s+='<td width="32" bgcolor="'+item.toHex()+'"> </td>';
36 s+='<td width="32"> </td>';
39 t.debug(s+'</tr></table>');
42 function testTriadic(t){
44 var a=dojox.color.Generator.triadic({ base:new dojox.color.Color({r:128, g:0, b:0}) });
45 var s='<h3>dojox.color.Generator.triadic</h3><table cellpadding="0" cellspacing="1" border="0"><tr>';
47 dojo.forEach(a, function(item){
48 if(c++%cols==0){ s+="</tr><tr>"; }
49 s+='<td width="32" bgcolor="'+item.toHex()+'"> </td>';
53 s+='<td width="32"> </td>';
56 t.debug(s+'</tr></table>');
59 function testComplementary(t){
61 var a=dojox.color.Generator.complementary({ base:new dojox.color.Color({r:128, g:0, b:0}) });
62 var s='<h3>dojox.color.Generator.complementary</h3><table cellpadding="0" cellspacing="1" border="0"><tr>';
64 dojo.forEach(a, function(item){
65 if(c++%cols==0){ s+="</tr><tr>"; }
66 s+='<td width="32" bgcolor="'+item.toHex()+'"> </td>';
70 s+='<td width="32"> </td>';
73 t.debug(s+'</tr></table>');
76 function testSplitComplementary(t){
78 var a=dojox.color.Generator.splitComplementary({ base:new dojox.color.Color({r:128, g:0, b:0}) });
79 var s='<h3>dojox.color.Generator.splitComplementary</h3><table cellpadding="0" cellspacing="1" border="0"><tr>';
81 dojo.forEach(a, function(item){
82 if(c++%cols==0){ s+="</tr><tr>"; }
83 s+='<td width="32" bgcolor="'+item.toHex()+'"> </td>';
87 s+='<td width="32"> </td>';
90 t.debug(s+'</tr></table>');
93 function testCompound(t){
95 var a=dojox.color.Generator.compound({ base:new dojox.color.Color({r:128, g:0, b:0}) });
96 var s='<h3>dojox.color.Generator.compound</h3><table cellpadding="0" cellspacing="1" border="0"><tr>';
98 dojo.forEach(a, function(item){
99 if(c++%cols==0){ s+="</tr><tr>"; }
100 s+='<td width="32" bgcolor="'+item.toHex()+'"> </td>';
104 s+='<td width="32"> </td>';
107 t.debug(s+'</tr></table>');
110 function testShades(t){
112 var a=dojox.color.Generator.shades({ base:new dojox.color.Color({r:128, g:0, b:0}) });
113 var s='<table cellpadding="0" cellspacing="1" border="0"><tr>';
115 dojo.forEach(a, function(item){
116 if(c++%cols==0){ s+="</tr><tr>"; }
117 s+='<td width="32" bgcolor="'+item.toHex()+'"> </td>';
121 s+='<td width="32"> </td>';
124 t.debug(s+'</tr></table>');