Reference for push_style
Save current styling. This is part of the reference section.
Arc
Buffer
Data
Dialog
Ellipse
Geo Utils
Image
Joystick (future)
Keyboard
Line
Mouse / Touchscreen
Pixel
Rectangle
Renderers
Shape
Sound (future)
Style
push_style
System
Text
Transform
Purpose
Save current sketch styling to the style history. This works as a stack (like a stack of plates) where this puts a new plate on the top of the pile. This will leave the current style configuration in the sketch unchanged.
Snippet
Save a green fill and restore it later to draw a green rectangle.
sketch.set_fill('#00C000') # Set fill to green sketch.push_style() # Save the current styling sketch.set_fill('#C00000') # Set it to red sketch.pop_style() # Restore saved styling so fill is green again sketch.rect(50, 100, 150, 200)
Examples
Availability
Available on all platforms.