forked from WupperWWEM/wupperwwem.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyTimer.js
More file actions
16 lines (16 loc) · 727 Bytes
/
myTimer.js
File metadata and controls
16 lines (16 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function myTimer({source,color_start,color_end,layer_array}) {
var data = {};
$.getJSON(source, function(source) {
for (var key in source){
data[key] = source[key];
};
textLayer["renderables"][0]["text"] = data.date;
delete data.date;
var rgb_dic = coloring(data,color_start,color_end);
for (var key in rgb_dic) {
//layer_array[key].scene.materials.stuff.diffuse = new Float32Array([rgb_dic[key][0]/255,rgb_dic[key][1]/255,rgb_dic[key][2]/255,1]);
layer_array[key]._entities[0].material.diffuse = new Float32Array([rgb_dic[key][0]/255,rgb_dic[key][1]/255,rgb_dic[key][2]/255,1]);
};
});
wwd.redraw();
};