|
1 | | -import random |
| 1 | +import random as rnd |
2 | 2 |
|
3 | 3 | from PIL import Image, ImageColor, ImageFont, ImageDraw, ImageFilter |
4 | 4 |
|
@@ -27,9 +27,9 @@ def _generate_horizontal_text(text, font, text_color, font_size, space_width, fi |
27 | 27 | c1, c2 = colors[0], colors[-1] |
28 | 28 |
|
29 | 29 | fill = ( |
30 | | - random.randint(min(c1[0], c2[0]), max(c1[0], c2[0])), |
31 | | - random.randint(min(c1[1], c2[1]), max(c1[1], c2[1])), |
32 | | - random.randint(min(c1[2], c2[2]), max(c1[2], c2[2])) |
| 30 | + rnd.randint(min(c1[0], c2[0]), max(c1[0], c2[0])), |
| 31 | + rnd.randint(min(c1[1], c2[1]), max(c1[1], c2[1])), |
| 32 | + rnd.randint(min(c1[2], c2[2]), max(c1[2], c2[2])) |
33 | 33 | ) |
34 | 34 |
|
35 | 35 | for i, w in enumerate(words): |
@@ -57,9 +57,9 @@ def _generate_vertical_text(text, font, text_color, font_size, space_width, fit) |
57 | 57 | c1, c2 = colors[0], colors[-1] |
58 | 58 |
|
59 | 59 | fill = ( |
60 | | - random.randint(c1[0], c2[0]), |
61 | | - random.randint(c1[1], c2[1]), |
62 | | - random.randint(c1[2], c2[2]) |
| 60 | + rnd.randint(c1[0], c2[0]), |
| 61 | + rnd.randint(c1[1], c2[1]), |
| 62 | + rnd.randint(c1[2], c2[2]) |
63 | 63 | ) |
64 | 64 |
|
65 | 65 | for i, c in enumerate(text): |
|
0 commit comments