Skip to content

Instantly share code, notes, and snippets.

@wanghailei
Last active June 25, 2024 00:33
Show Gist options
  • Save wanghailei/9ebd5511c9c48ac903c0 to your computer and use it in GitHub Desktop.
Save wanghailei/9ebd5511c9c48ac903c0 to your computer and use it in GitHub Desktop.
Code snippets of Tsunami
# 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 )
@genidma
Copy link

genidma commented Mar 26, 2018

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment