-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmake_logo.py
More file actions
47 lines (37 loc) · 1.21 KB
/
make_logo.py
File metadata and controls
47 lines (37 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Prepare myconnectome logo data for graphic
import string
import random
import sys
""" hidden: string (with spaces between letters) to hide
rows: total number of rows
row: row for hidden text
length: row length
"""
def generate(hidden,rows=3,row=2,length=124,color="#CCC",color_hidden="#000"):
hidden = list(hidden)
# Generate a random set of letters
abc = string.letters.upper()
letters = []
for rr in range(rows):
letters.append([random.choice(abc) for r in range(length)])
# Matched to colors
colors = []
for rr in range(rows):
colors.append([color for r in range(length)])
# Put in the hidden word
for h in range(len(hidden)):
letters[row-1][h+4] = hidden[h]
colors[row-1][h+4] = color_hidden
# Generate x and y coordinates
xcoords = []
ycoords = []
letter_vector = []
color_vector = []
for l in range(len(letters)):
for ll in range(len(letters[l])):
xcoords.append((ll*30)+10)
ycoords.append(l*20)
letter_vector.append(letters[l][ll])
color_vector.append(colors[l][ll])
# Return letters, colors, xcoords, ycoords
return letter_vector, color_vector, xcoords, ycoords