Created
April 27, 2016 20:13
-
-
Save AnnaMag/7cf4d66bbe5b97e519eb90ef591437de to your computer and use it in GitHub Desktop.
graphical experiments1
This file contains hidden or 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
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