Advertisement
xeromino

colorVar

Jan 29th, 2016
300
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(540, 540);
  4.      glc.setDuration(3);
  5.      glc.setFPS(35);
  6.     glc.styles.backgroundColor = "#202020";
  7. //     glc.setMode('single');
  8. //     glc.setEasing(false);
  9.     var list = glc.renderList,
  10.         width = glc.w,
  11.         height = glc.h,
  12.         color = glc.color;
  13.  
  14.     // your code goes here:
  15.    
  16.     var w = 300,
  17.         c = 0;
  18.         step = 10;
  19.    
  20.     while( w>0) {
  21.         c++;
  22.         list.addRect({
  23.             x: width / 2,
  24.             y: height / 2,
  25.             w: [15,w],
  26.             h: [w,15],
  27.             //fill: false,
  28.             //stroke: true,
  29.             //strokeStyle: color.hsva(360-360/40*c,1,1,.5),
  30.             fill: true,
  31.             stroke: true,
  32.             strokeStyle: color.rgba(255,255,255,.5),
  33.             fillStyle: color.hsva(150/30*c,1,1,1),
  34.             lineWidth:1,
  35.             //rotation: [-90+c*4,90+c*2],
  36.             rotation: [0,180],
  37.             phase: c/150
  38.             //phase: .5/c,
  39.             //phase: Math.sin(w*0.001)
  40.         });
  41.         w -= step;
  42.     }
  43.    
  44.     list.addText({
  45.         x: width-50,
  46.         y: height-15,
  47.         text: "p5art.tumblr.com",
  48.         fontSize: 10,
  49.         fillStyle: color.rgba(255,255,255,.5),
  50.        
  51.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement