Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onGLC(glc) {
- glc.loop();
- // glc.size(400, 400);
- glc.setDuration(3);
- // glc.setFPS(20);
- // glc.setMode("single");
- glc.setEasing(false);
- // glc.setMaxColors(256);
- var r = 20, g = 20, b = 150;
- glc.styles.backgroundColor = "rgba("+r+","+g+","+b+",0.1)";
- var list = glc.renderList,
- width = glc.w,
- height = glc.h,
- color = glc.color;
- var numCircles = 6, span = 70;
- for (var k = span; k < height; k+=span) {
- for (var j = span; j < width; j+=span) {
- var rad = Math.random()*15+10,
- endRad = rad / 5,
- circleRadius = Math.PI*rad / numCircles,
- flowerColor = color.randomRGB(70,255);
- var container = list.addContainer({
- x: j,
- y: k,
- rotation: [0, 360 / numCircles*6]
- });
- list.addCircle({
- x: 0,
- y: 0,
- radius: rad,
- fill: true,
- fillStyle: flowerColor,
- parent: container
- })
- for (var i = 0; i < numCircles; i++) {
- newX = Math.cos(2 * Math.PI * i / numCircles) * rad;
- newY = Math.sin(2 * Math.PI * i / numCircles) * rad;
- list.addCircle({
- x: newX,
- y: newY,
- fill: true,
- fillStyle: flowerColor,
- stroke: false,
- radius: circleRadius-1,
- parent: container
- })
- };
- for (var i = 0; i < numCircles/2; i++) {
- newX = Math.cos(2 * Math.PI * i / (numCircles / 2)) * rad;
- newY = Math.sin(2 * Math.PI * i / (numCircles / 2)) * rad;
- list.addCircle({
- x: newX,
- y: newY,
- fill: true,
- fillStyle: color.rgb(r,g,b),
- stroke: false,
- radius: circleRadius,
- parent: container
- })
- };
- };
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment