Advertisement
rric

dark_blue_sea_view

Oct 16th, 2023 (edited)
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.85 KB | None | 0 0
  1. # Draws a seascape with circles and rectangles [Processing.py]
  2. # Copyright 2021-2023 Roland Richter
  3.  
  4. from __future__ import division, print_function
  5.  
  6. # Create a 800×500 canvas
  7. size(800, 500)
  8.  
  9. # Whoops! I wanted to convert #87CEEB "Light sky blue" to
  10. # its RGB form, but something went wrong.  
  11. # TRY to use the Color Selector tool to convert #87CEEB!
  12. bg = color(120, 8, 48)
  13. background(bg)
  14.  
  15. # QUIZ What's the difference between stroke and fill color?
  16. # HINT Look it up at https://py.processing.org/reference/
  17. stroke("#483C32")  # "Dark lava"
  18. fill("#087830")    # "La Salle Green"
  19.  
  20. # Draw an island in "La Salle Green"
  21. circle(0.5*width, height, 0.6*height)
  22.  
  23. # Draw the sea across the lower part of the window
  24. noStroke()
  25. fill("#08457E") # "Dark cerulean"
  26. rect(0, 0.8*height, width, height)
  27.  
  28. # Paint a white cloud ...
  29. fill("#FFFFFF")
  30. circle(0.75*width, 0.30*height, 84)
  31. circle(0.72*width, 0.31*height, 84)
  32. circle(0.77*width, 0.28*height, 84)
  33. circle(0.79*width, 0.32*height, 84)
  34.  
  35. # ... and the yellow sun
  36. fill("#FFFF00")
  37. circle(850, 70, 90)
  38.  
  39. # Can't see the sun in the sky? Uhm, why not ...?
  40. # TRY to draw the circle in a suitable place
  41.  
  42. # ----------------------------------------------------------------------
  43. # This program is free software: you can redistribute it and/or modify
  44. # it under the terms of the GNU General Public License as published by
  45. # the Free Software Foundation, either version 3 of the License, or
  46. # (at your option) any later version.
  47. #
  48. # This program is distributed in the hope that it will be useful,
  49. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  50. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  51. # GNU General Public License for more details.
  52. #
  53. # You should have received a copy of the GNU General Public License
  54. # along with this program.  If not, see <https://www.gnu.org/licenses/>.
  55.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement