Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onGLC(glc) {
- glc.loop();
- // glc.playOnce();
- glc.size(540, 540);
- glc.setDuration(2.5);
- glc.setFPS(40);
- glc.setMode("single");
- //glc.styles.backgroundColor = "rgba(255,255,255,.3)";
- // glc.setEasing(false);
- var list = glc.renderList,
- width = glc.w,
- height = glc.h,
- color = glc.color;
- // your code goes here:
- var edge = width/5
- num = 4,
- sz = (width-2*edge)/num,
- rad = sz*.4;
- var linearGradient = glc.getContext().createLinearGradient(0, -sz/2, 0, sz/2);
- linearGradient.addColorStop(0, "black");
- linearGradient.addColorStop(1, "white");
- var radialGradient = glc.getContext().createRadialGradient(0, 0, 0, 0, 0, sz/2);
- radialGradient.addColorStop(0, "white");
- radialGradient.addColorStop(1, "darkred");
- for (var x=edge; x<=width-edge; x+=sz) {
- for (var y=edge; y<=height-edge; y+=sz){
- var s2=6, s = Math.floor(3+Math.random()*s2),
- r = Math.random()*360;
- if (Math.random()*1>.1){
- list.addPoly({
- x: x,
- y: y,
- sides: s,
- rotation: [r,r+360],
- lineWidth: 1,
- //fill:false,
- //fillStyle: "rgba(0,0,0,.2)",
- //fillStyle: color.hsv(360/s2*s,.8,.8),
- fillStyle: linearGradient,
- stroke: false,
- strokeStyle: "rgba(0,0,0,.8)",
- radius: rad,
- //shake: 5
- });
- } else {
- list.addCircle({
- x: x,
- y: y,
- radius: rad,
- fillStyle: radialGradient
- });
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement