ctx.fillRect(0, 0, 150, 150); // Draw a rectangle with default settings
ctx.save(); // Save the default state
ctx.setFillStyle("#09F"); // Make changes to the settings
ctx.fillRect(15, 15, 120, 120); // Draw a rectangle with new settings
ctx.save(); // Save the current state
ctx.setFillStyle("#FFF"); // Make changes to the settings
ctx.setGlobalAlpha(0.5);
ctx.fillRect(30, 30, 90, 90); // Draw a rectangle with new settings