Created
September 13, 2013 20:09
-
-
Save tomstuder/6555454 to your computer and use it in GitHub Desktop.
attempting 2 color variable sets, and 2 HShapeLayouts in processing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HDrawablePool pool; | |
HColorPool colors; | |
void setup(){ | |
size(600,600); | |
H.init(this).background(#202020); | |
smooth(); | |
colors = new HColorPool(#FFFFFF, #F7F7F7, #ECECEC, #333333, #0095a8, #00616f, #FF3300, #FF6600); | |
colorsb = new HColorPool(#E2E2E2, #C2c2c2, #C3c3a2); | |
pool = new HDrawablePool(2000); | |
pool.autoAddToStage() | |
// .add(new HShape("svg1.svg")) | |
// .add(new HShape("svg2.svg")) | |
// .add(new HShape("svg3.svg")) | |
// .add(new HShape("svg4.svg")) | |
.add(new HShape("svg5.svg")) | |
// .add(new HShape("svg6.svg")) | |
.layout( | |
new HShapeLayout() | |
.target( | |
new HImage("shapeMap.png") | |
) | |
) | |
.onCreate( | |
new HCallback() { | |
public void run(Object obj) { | |
HShape d = (HShape) obj; | |
d | |
.enableStyle(false) | |
.noStroke() | |
.anchorAt(H.CENTER) | |
.size( (int)random(10,30) ) | |
.rotate( (int)random(360) ) | |
; | |
d.randomColors(colors.fillOnly()); | |
} | |
} | |
) | |
.requestAll() | |
; | |
pool = new HDrawablePool(100); | |
pool.autoAddToStage() | |
// .add(new HShape("svg1.svg")) | |
// .add(new HShape("svg2.svg")) | |
// .add(new HShape("svg3.svg")) | |
.add(new HShape("svg4.svg")) | |
// .add(new HShape("svg5.svg")) | |
// .add(new HShape("svg6.svg")) | |
.layout( | |
new HShapeLayout() | |
.target( | |
new HImage("shapeMap2.png") | |
) | |
) | |
.onCreate( | |
new HCallback() { | |
public void run(Object obj) { | |
HShape d = (HShape) obj; | |
d | |
.enableStyle(false) | |
.noStroke() | |
.anchorAt(H.CENTER) | |
.size( (int)random(60,130) ) | |
.rotate( (int)random(360) ) | |
; | |
d.randomColors(colorsb.fillOnly()); | |
} | |
} | |
) | |
.requestAll() | |
; | |
H.drawStage(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HDrawablePool p1, p2;
HColorPool c1, c2;
void setup(){
size(600,600);
H.init(this).background(#202020);
smooth();
}