Debian Codegraph @

dojox/color/tests/ColorModel.js

raw symbols SCIP
1 define(["doh", "dojo/_base/declare", "../MeanColorModel", "..", "dijit/_WidgetBase"],
2 function(doh, declare, MeanColorModel, color, _WidgetBase){
3 doh.register("tests.MeanColorModel", [
4 function test_Values(t){
5 var cm = new MeanColorModel(new color.Color([0, 0, 0]), new color.Color([100, 100, 100]));
6 cm.initialize([0, 10, 20], function(item){
7 return item;
8 });
9 t.is([50, 50, 50], cm.getColor(10).toRgb());
10 t.is([0, 0, 0], cm.getColor(0).toRgb());
11 t.is([99, 99, 99], cm.getColor(20).toRgb());
12
13 cm.initialize([0, 5, 20], function(item){
14 return item;
15 });
16 t.is([50, 50, 50], cm.getColor(5).toRgb());
17 t.is([0, 0, 0], cm.getColor(0).toRgb());
18 t.is([99, 99, 99], cm.getColor(20).toRgb());
19
20 }
21 ]);
22 });