Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onGLC(glc) {
- glc.loop();
- // glc.size(400, 400);
- // glc.setDuration(5);
- // glc.setFPS(20);
- // glc.setMode("single");
- // glc.setEasing(false);
- // glc.setMaxColors(256);
- var r = 50, g = 170, b = 255;
- glc.styles.backgroundColor = "rgba("+r+","+g+","+b+",0.15)";
- var list = glc.renderList,
- width = glc.w,
- height = glc.h,
- color = glc.color;
- var numCircles = 50,
- rad = 170,
- endRad = rad / 5,
- circleRadius = Math.PI*rad / numCircles;
- list.addCircle({
- x: width/2,
- y: height/2,
- radius: [rad,endRad],
- fill: true,
- fillStyle: "yellow"
- })
- 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;
- newX2 = Math.cos(2 * Math.PI * i / numCircles) * endRad;
- newY2 = Math.sin(2 * Math.PI * i / numCircles) * endRad;
- list.addCircle({
- x: [newX+width/2,newX2+width/2],
- y: [newY+height/2,newY2+height/2],
- fill: true,
- fillStyle: "yellow",
- stroke: false,
- radius: [circleRadius-1,circleRadius / (rad / endRad) - 1]
- })
- };
- 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;
- newX2 = Math.cos(2 * Math.PI * i / (numCircles / 2)) * endRad;
- newY2 = Math.sin(2 * Math.PI * i / (numCircles / 2)) * endRad;
- list.addCircle({
- x: [newX+width/2,newX2+width/2],
- y: [newY+height/2,newY2+height/2],
- fill: true,
- fillStyle: color.rgb(r,g,b),
- stroke: false,
- radius: [circleRadius,circleRadius / (rad / endRad)]
- })
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment