1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 6x 12x 12x 12x 12x 12090x 11314x 776x 6x | export const StaticSchemeClass = function(map){ this.defaultColor = "#ffffff"; this.type = "static"; this.map = map; this.getColor = function(letter){ if(this.map[letter] !== undefined){ return this.map[letter]; }else{ return this.defaultColor; } }; }; export const DynSchemeClass = function(fun,opt){ this.type = "dyn"; this.opt = opt; // init if(fun.init !== undefined){ fun.init.call(this); this.getColor = fun.run; this.reset = fun.init; }else{ this.getColor = fun; } }; |