eriknau

color shift

Dec 14th, 2015
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onGLC(glc) {
  2.     glc.loop();
  3.     // glc.size(400, 400);
  4.     glc.setDuration(5);
  5.     // glc.setFPS(20);
  6.     // glc.setMode("single");
  7.     // glc.setEasing(false);
  8.     // glc.setMaxColors(256);
  9.         glc.styles.backgroundColor = "white";
  10.     var list = glc.renderList,
  11.         width = glc.w,
  12.         height = glc.h,
  13.         color = glc.color;
  14.         var rowHeight = 100;
  15.     for (var i = 0; i < height; i+=rowHeight) {
  16.         for (var j = 0; j < width; j+=100) {
  17.             // var x1 = (Math.random()*width)-100;
  18.             list.addRect({
  19.                 x: [j,j + Math.random()*width-width/2],
  20.                 y: i,
  21.                 // w: Math.random()*100+50,
  22.                 w: 100,
  23.                 h: rowHeight,
  24.                 fillStyle: color.hsva(Math.random()*360,1,1,0.4),
  25.                 drawFromCenter: false,
  26.                 phase: i*0.1
  27.             })
  28.         };
  29.     };
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment