Search processing.org:

Reference for Processing version 1.0.1+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name

### popStyle()

Examples

    smooth();
    ellipse(0, 50, 33, 33);    // Left
    pushStyle();               // Start a new style
    strokeWeight(10);
    fill(204, 153, 0);
    ellipse(50, 50, 33, 33);   // Middle
    popStyle();                // Restore original style
    ellipse(100, 50, 33, 33);  // Right

    smooth();
    ellipse(0, 50, 33, 33);    // Left
    pushStyle();               // Start a new style
    strokeWeight(10);
    fill(204, 153, 0);
    ellipse(33, 50, 33, 33);   // Left-Middle
    pushStyle();               // Start another new style
    stroke(0, 102, 153);
    ellipse(66, 50, 33, 33);   // Right-Middle
    popStyle();                // Restore the previous style
    popStyle();                // Restore original style
    ellipse(100, 50, 33, 33);  // Right

Description

The pushStyle() function saves the current style settings and popStyle() restores the prior settings; these functions are always used together. They allow you to change the style settings and later return to what you had. When a new style is started with pushStyle(), it builds on the current style information. The pushStyle() and popStyle() functions can be embedded to provide more control (see the second example above for a demonstration.)

Syntax

    popStyle()

Returns | None
Usage | Web & Application
Related | pushStyle()

Updated on November 22, 2008 08:39:26pm PST