1717
1818
1919def font (size : int , bold : bool = True ):
20- for path , idx in [("/System/Library/Fonts/Helvetica.ttc" , 1 if bold else 0 ),
21- ("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf" , 0 ),
22- ("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" , 0 )]:
20+ for path , idx in [
21+ ("/System/Library/Fonts/Helvetica.ttc" , 1 if bold else 0 ),
22+ ("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf" , 0 ),
23+ ("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" , 0 ),
24+ ]:
2325 try :
2426 return ImageFont .truetype (path , size , index = idx )
2527 except OSError :
@@ -42,7 +44,10 @@ def northpeak_trail():
4244 """Clean sneaker ad: low text, brand visible, nothing restricted."""
4345 img = Image .new ("RGB" , (W , H ), "#2E4A3A" )
4446 d = ImageDraw .Draw (img )
45- d .polygon ([(0 , 800 ), (300 , 500 ), (560 , 700 ), (820 , 420 ), (1080 , 640 ), (1080 , 1080 ), (0 , 1080 )], fill = "#22382C" )
47+ d .polygon (
48+ [(0 , 800 ), (300 , 500 ), (560 , 700 ), (820 , 420 ), (1080 , 640 ), (1080 , 1080 ), (0 , 1080 )],
49+ fill = "#22382C" ,
50+ )
4651 d .ellipse ([340 , 620 , 740 , 820 ], fill = "#4A5A50" ) # rock
4752 # the shoe
4853 d .rounded_rectangle ([400 , 520 , 700 , 640 ], 40 , fill = "#D7DBD2" )
@@ -59,8 +64,12 @@ def betpeak_bonus():
5964 (deliberately NO 1-800-GAMBLER — the NJ rule should catch it)."""
6065 img = Image .new ("RGB" , (W , H ), "#101820" )
6166 d = ImageDraw .Draw (img )
62- for x , y , r , c in [(180 , 760 , 110 , "#C43A20" ), (320 , 830 , 95 , "#1B6B4A" ),
63- (120 , 930 , 80 , "#B8860B" ), (420 , 960 , 70 , "#3B3F8C" )]:
67+ for x , y , r , c in [
68+ (180 , 760 , 110 , "#C43A20" ),
69+ (320 , 830 , 95 , "#1B6B4A" ),
70+ (120 , 930 , 80 , "#B8860B" ),
71+ (420 , 960 , 70 , "#3B3F8C" ),
72+ ]:
6473 d .ellipse ([x - r , y - r , x + r , y + r ], fill = c , outline = "#E8E4D8" , width = 6 )
6574 d .ellipse ([x - r + 18 , y - r + 18 , x + r - 18 , y + r - 18 ], outline = "#E8E4D8" , width = 3 )
6675 d .text ((70 , 130 ), "GET UP TO" , font = font (64 ), fill = "#E8E4D8" )
@@ -77,7 +86,13 @@ def peaklend_rate():
7786 img = Image .new ("RGB" , (W , H ), "#123B2E" )
7887 d = ImageDraw .Draw (img )
7988 for i in range (6 ):
80- d .arc ([600 - i * 60 , 300 - i * 60 , 1400 + i * 60 , 1100 + i * 60 ], 180 , 300 , fill = "#1B5240" , width = 8 )
89+ d .arc (
90+ [600 - i * 60 , 300 - i * 60 , 1400 + i * 60 , 1100 + i * 60 ],
91+ 180 ,
92+ 300 ,
93+ fill = "#1B5240" ,
94+ width = 8 ,
95+ )
8196 d .text ((70 , 140 ), "Personal loans" , font = font (66 ), fill = "#EAF2ED" )
8297 d .text ((70 , 250 ), "from" , font = font (66 ), fill = "#EAF2ED" )
8398 d .text ((70 , 340 ), "3.9%" , font = font (220 ), fill = "#8FE3B0" )
0 commit comments