Setting Colors For Patterns
Setting Colors for Patterns
Example Use - Fixed Color
///In Pattern class definition
//Pattern constructor that takes color as an input parameter
Pattern( PShape s, color fillColor){
this.s = s;
this.fillColor = fillColor;
}
//main tab - initialization in setup()
PShape shape1 = createShape( RECT, 0,0,40,80);
color color1 = color( 200,100,100);
Pattern pattern0 = new Pattern(shape1, color1);
//in drawPattern( )
pattern0.display(mouseX, mouseY); //displayed using color1Example Use - Dynamic Color
Pattern Class that handles all types of PShapes
Last updated