Skip to content

Instantly share code, notes, and snippets.

@AnnaMag
Created April 27, 2016 20:13
Show Gist options
  • Save AnnaMag/7cf4d66bbe5b97e519eb90ef591437de to your computer and use it in GitHub Desktop.
Save AnnaMag/7cf4d66bbe5b97e519eb90ef591437de to your computer and use it in GitHub Desktop.
graphical experiments1
colors = ximport( "colors" )
font( "Courier", 350 )
align( CENTER )
text_path_line = textpath( "PURA VIDA", 0, 200, width = WIDTH)
resx = 200
resy = 80
rx = 2.0
ry = 1.5
dotsize = 5.5
dx = WIDTH / float( resx )
dy = HEIGHT / float( resy )
def draw_text() :
nofill()
strokewidth( random( 0.6, 2.8 ) )
clr = choice( [ colors.hex( "#FF0000" ), colors.hex( "#FF0053" ), colors.hex( "#000003" ), colors.hex( "#FF0011" ) ] )
clr.a = random( 0.6, 1 )
stroke( clr )
oval( pointx + random( -rx, rx ), pointy + random( -ry, ry ), size, size )
for x, y in grid( resx, resy ) :
size = choice( [ 1, 2, 2, 2, 3, 3, 3, dotsize ] )
pointx = x * dx - size
pointy = y * dy - size
if text_path_line.contains( pointx, pointy ):
draw_text()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment