Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import processing.pdf.*;
- HColorPool colors;
- HShape a;
- HShape b;
- HShape c;
- HShape d;
- HShape e;
- HShape f;
- HShape g;
- HShape h;
- HShape r;
- HShape j;
- HShape k;
- HShape l;
- HShape m;
- HShape n;
- HShape o;
- HShape p;
- HShape q;
- void setup(){
- size(1340,700);
- H.init(this).background(#000056);
- smooth();
- colors = new HColorPool()
- .add(#8e54fa,25)
- .add(#8081f9,20)
- .add(#4a3dd3,15)
- .add(#63fdfa,10)
- .add(#f491f4,15)
- .add(#fda07c,10)
- .add(#eff1e1,5)
- ;
- for (int i = 0; i < 5; ++i) {
- a = new HShape("25circle.svg");
- a
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(10,30) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- a.randomColors(colors.fillOnly());
- H.add(a);
- }
- for (int i = 0; i < 5; ++i) {
- b = new HShape("75circle.svg");
- b
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(10,30) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- b.randomColors(colors.fillOnly());
- H.add(b);
- }
- for (int i = 0; i < 5; ++i) {
- c = new HShape("cgrid.svg");
- c
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(20,50) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- c.randomColors(colors.fillOnly());
- H.add(c);
- }
- for (int i = 0; i < 40; ++i) {
- d = new HShape("circle.svg");
- d
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(10,320) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- d.randomColors(colors.fillOnly());
- H.add(d);
- }
- for (int i = 0; i < 5; ++i) {
- e = new HShape("dots.svg");
- e
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(40,60) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- e.randomColors(colors.fillOnly());
- H.add(e);
- }
- for (int i = 0; i < 10; ++i) {
- f = new HShape("heart.svg");
- f
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(30,70) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- f.randomColors(colors.fillOnly());
- H.add(f);
- }
- for (int i = 0; i < 5; ++i) {
- g = new HShape("lessthan.svg");
- g
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(10,30) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- g.randomColors(colors.fillOnly());
- H.add(g);
- }
- for (int i = 0; i < 5; ++i) {
- h = new HShape("line1.svg");
- h
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(100,250) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- h.randomColors(colors.fillOnly());
- H.add(h);
- }
- for (int i = 0; i < 10; ++i) {
- r = new HShape("line2.svg");
- r
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(100,250) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- r.randomColors(colors.fillOnly());
- H.add(r);
- }
- for (int i = 0; i < 5; ++i) {
- j = new HShape("one.svg");
- j
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(100,250) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- j.randomColors(colors.fillOnly());
- H.add(j);
- }
- for (int i = 0; i < 5; ++i) {
- k = new HShape("two.svg");
- k
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(20,45) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- k.randomColors(colors.fillOnly());
- H.add(k);
- }
- for (int i = 0; i < 60; ++i) {
- q = new HShape("pill.svg");
- q
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(5,15) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- q.randomColors(colors.fillOnly());
- H.add(q);
- }
- for (int i = 0; i < 5; ++i) {
- l = new HShape("pills.svg");
- l
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(50,150) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- l.randomColors(colors.fillOnly());
- H.add(l);
- }
- for (int i = 0; i < 10; ++i) {
- m = new HShape("smiley.svg");
- m
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(50,200) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- m.randomColors(colors.fillOnly());
- H.add(m);
- }
- for (int i = 0; i < 5; ++i) {
- n = new HShape("smiley2.svg");
- n
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(30,60) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- n.randomColors(colors.fillOnly());
- H.add(n);
- }
- for (int i = 0; i < 60; ++i) {
- o = new HShape("square.svg");
- o
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(5,15) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- o.randomColors(colors.fillOnly());
- H.add(o);
- }
- for (int i = 0; i < 50; ++i) {
- p = new HShape("triangle.svg");
- p
- .enableStyle(false)
- // .noStroke()
- .strokeJoin(ROUND)
- .strokeCap(ROUND)
- .strokeWeight(.5)
- .rotate( (int)random(360) )
- .size( (int)random(5,15) )
- .loc( (int)random(width), (int)random(height) )
- .anchorAt(H.CENTER)
- ;
- p.randomColors(colors.fillOnly());
- H.add(p);
- }
- noLoop();
- saveVector();
- H.drawStage();
- }
- void draw() {
- H.drawStage();
- }
- void saveVector() {
- PGraphics tmp = null;
- tmp = beginRecord(PDF, "render_05.pdf");
- if (tmp == null) {
- H.drawStage();
- } else {
- H.stage().paintAll(tmp, false, 1); // PGraphics, uses3D, alpha
- }
- endRecord();
- }
Add Comment
Please, Sign In to add comment