Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Draws a seascape with circles and rectangles [Processing.py]
- # Copyright 2021-2023 Roland Richter
- from __future__ import division, print_function
- # Create a 800×500 canvas
- size(800, 500)
- # Whoops! I wanted to convert #87CEEB "Light sky blue" to
- # its RGB form, but something went wrong.
- # TRY to use the Color Selector tool to convert #87CEEB!
- bg = color(120, 8, 48)
- background(bg)
- # QUIZ What's the difference between stroke and fill color?
- # HINT Look it up at https://py.processing.org/reference/
- stroke("#483C32") # "Dark lava"
- fill("#087830") # "La Salle Green"
- # Draw an island in "La Salle Green"
- circle(0.5*width, height, 0.6*height)
- # Draw the sea across the lower part of the window
- noStroke()
- fill("#08457E") # "Dark cerulean"
- rect(0, 0.8*height, width, height)
- # Paint a white cloud ...
- fill("#FFFFFF")
- circle(0.75*width, 0.30*height, 84)
- circle(0.72*width, 0.31*height, 84)
- circle(0.77*width, 0.28*height, 84)
- circle(0.79*width, 0.32*height, 84)
- # ... and the yellow sun
- fill("#FFFF00")
- circle(850, 70, 90)
- # Can't see the sun in the sky? Uhm, why not ...?
- # TRY to draw the circle in a suitable place
- # ----------------------------------------------------------------------
- # This program is free software: you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation, either version 3 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program. If not, see <https://www.gnu.org/licenses/>.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement