Last active
February 21, 2025 13:24
Code snippets of Tsunami
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following code and the code generated art works are the intellectrual properities of Hailei Wang. | |
# © 2010 - 2014, Hailei Wang. All rights reserved. | |
cornu = ximport("cornu") | |
colors = ximport("colors") | |
# Painting waves | |
palette_for_wave = [ colors.hex( “#020034”, “dark blue” ), colors.hex( “#0A5CD6”, “aqua blue” ), colors.hex( “#FEFFFF”, “milk white” ) ] | |
# Draw Wave | |
def draw_wave( path, palette_for_wave ) : | |
stroke_width( choice( [ random( 0.1, 100 ), random( 1, 1000 ) ] ) ) | |
stroke( choice( palette_for_wave ) ) | |
cornu.draw_path( path, close = False, flat = True ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Hailei,
Do you know why I am getting the following error?
File "cstsunami.py", line 11 def draw_wave( path, palette_for_wave ) : ^ SyntaxError: invalid syntax
Many thanks in advance!