Skip to content

Commit e8f3b76

Browse files
committed
Apply ruff formatter to generate_marketing_screenshots.py
- Consistent inline comment spacing (2 spaces) - Collapse single-line dictionaries - Use double quotes consistently - Split function parameters more uniformly - Add blank line after imports in functions
1 parent d242c25 commit e8f3b76

1 file changed

Lines changed: 50 additions & 57 deletions

File tree

scripts/generate_marketing_screenshots.py

Lines changed: 50 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -24,68 +24,44 @@
2424
OUTPUT_DIR = ASSETS_DIR / "marketing"
2525

2626
# CortexOS Brand Colors (vibrant, electric aesthetic)
27-
BRAND_GRADIENT_START = (15, 23, 42) # Deep navy
28-
BRAND_GRADIENT_MID = (88, 28, 135) # Vivid purple
29-
BRAND_GRADIENT_END = (157, 23, 77) # Hot magenta
30-
BRAND_ACCENT_CYAN = (6, 182, 212) # Electric cyan
31-
BRAND_ACCENT_VIOLET = (139, 92, 246) # Bright violet
32-
BRAND_ACCENT_PINK = (236, 72, 153) # Hot pink
33-
BRAND_ACCENT_BLUE = (59, 130, 246) # Electric blue
34-
BRAND_TEXT_PRIMARY = (255, 255, 255) # White
27+
BRAND_GRADIENT_START = (15, 23, 42) # Deep navy
28+
BRAND_GRADIENT_MID = (88, 28, 135) # Vivid purple
29+
BRAND_GRADIENT_END = (157, 23, 77) # Hot magenta
30+
BRAND_ACCENT_CYAN = (6, 182, 212) # Electric cyan
31+
BRAND_ACCENT_VIOLET = (139, 92, 246) # Bright violet
32+
BRAND_ACCENT_PINK = (236, 72, 153) # Hot pink
33+
BRAND_ACCENT_BLUE = (59, 130, 246) # Electric blue
34+
BRAND_TEXT_PRIMARY = (255, 255, 255) # White
3535
BRAND_TEXT_SECONDARY = (255, 255, 255, 200) # White with alpha
3636

3737
# Marketing copy for each screen
3838
IPHONE_MARKETING = {
39-
"01_focus": {
40-
"headline": "Focus on\nWhat Matters",
41-
"subheadline": "AI-powered daily priorities"
42-
},
43-
"02_decide": {
44-
"headline": "Decide\nwith Clarity",
45-
"subheadline": "Record decisions that compound"
46-
},
47-
"03_capture": {
48-
"headline": "Capture\nEvery Thought",
49-
"subheadline": "Quick notes that build memory"
50-
},
51-
"04_settings": {
52-
"headline": "Your Thinking\nSystem",
53-
"subheadline": "Personalized to how you work"
54-
},
39+
"01_focus": {"headline": "Focus on\nWhat Matters", "subheadline": "AI-powered daily priorities"},
40+
"02_decide": {"headline": "Decide\nwith Clarity", "subheadline": "Record decisions that compound"},
41+
"03_capture": {"headline": "Capture\nEvery Thought", "subheadline": "Quick notes that build memory"},
42+
"04_settings": {"headline": "Your Thinking\nSystem", "subheadline": "Personalized to how you work"},
5543
}
5644

5745
MAC_MARKETING = {
58-
"01_focus": {
59-
"headline": "Your Command Center\nfor Clear Thinking",
60-
"subheadline": "See what matters today"
61-
},
46+
"01_focus": {"headline": "Your Command Center\nfor Clear Thinking", "subheadline": "See what matters today"},
6247
"02_insights": {
6348
"headline": "Insights That\nSurface Automatically",
64-
"subheadline": "Patterns you didn't know you had"
65-
},
66-
"03_ingest": {
67-
"headline": "Feed Your\nSecond Brain",
68-
"subheadline": "Import knowledge effortlessly"
69-
},
70-
"04_memory": {
71-
"headline": "Your Memory,\nOrganized",
72-
"subheadline": "Everything searchable, always ready"
73-
},
74-
"05_decisions": {
75-
"headline": "Decisions That\nCompound",
76-
"subheadline": "Build on past wisdom"
49+
"subheadline": "Patterns you didn't know you had",
7750
},
51+
"03_ingest": {"headline": "Feed Your\nSecond Brain", "subheadline": "Import knowledge effortlessly"},
52+
"04_memory": {"headline": "Your Memory,\nOrganized", "subheadline": "Everything searchable, always ready"},
53+
"05_decisions": {"headline": "Decisions That\nCompound", "subheadline": "Build on past wisdom"},
7854
}
7955

8056
# App Store screenshot dimensions
8157
DIMENSIONS = {
82-
"iPhone_6.9": (1320, 2868), # iPhone 16 Pro Max
83-
"iPhone_6.7": (1290, 2796), # iPhone 14 Pro Max
84-
"iPhone_6.5": (1242, 2688), # iPhone 11 Pro Max
85-
"iPhone_5.5": (1242, 2208), # iPhone 8 Plus
86-
"iPad_13": (2064, 2752), # iPad Pro 13"
87-
"iPad_12.9": (2048, 2732), # iPad Pro 12.9"
88-
"Mac": (2880, 1800), # macOS
58+
"iPhone_6.9": (1320, 2868), # iPhone 16 Pro Max
59+
"iPhone_6.7": (1290, 2796), # iPhone 14 Pro Max
60+
"iPhone_6.5": (1242, 2688), # iPhone 11 Pro Max
61+
"iPhone_5.5": (1242, 2208), # iPhone 8 Plus
62+
"iPad_13": (2064, 2752), # iPad Pro 13"
63+
"iPad_12.9": (2048, 2732), # iPad Pro 12.9"
64+
"Mac": (2880, 1800), # macOS
8965
}
9066

9167

@@ -116,6 +92,7 @@ def create_gradient(size, start_color, end_color, direction="vertical"):
11692
def create_vibrant_background(size, variant=0):
11793
"""Create a super vibrant multi-color gradient background with glowing orbs."""
11894
import math
95+
11996
width, height = size
12097

12198
# Create base with rich 3-stop gradient
@@ -248,7 +225,7 @@ def get_font(size, bold=False, style="headline"):
248225
if os.path.exists(path):
249226
try:
250227
# For .ttc files, index 0 is usually regular, higher indices are bolder
251-
if path.endswith('.ttc'):
228+
if path.endswith(".ttc"):
252229
index = 10 if bold or style == "headline" else 0 # Avenir Next Bold
253230
return ImageFont.truetype(path, size, index=index)
254231
return ImageFont.truetype(path, size)
@@ -259,8 +236,14 @@ def get_font(size, bold=False, style="headline"):
259236

260237

261238
def draw_text_with_glow(
262-
image, position, text, font, fill=(255, 255, 255),
263-
glow_color=(0, 0, 0), glow_radius=15, accent_glow=True,
239+
image,
240+
position,
241+
text,
242+
font,
243+
fill=(255, 255, 255),
244+
glow_color=(0, 0, 0),
245+
glow_radius=15,
246+
accent_glow=True,
264247
):
265248
"""Draw text with a strong glow effect and optional accent color for appeal."""
266249
from PIL import Image as PILImage
@@ -316,8 +299,8 @@ def draw_text_with_shadow(draw, position, text, font, fill=(255, 255, 255), shad
316299
x, y = position
317300
# Draw multiple shadow layers for a blur/glow effect
318301
shadow_offsets = [
319-
(8, 8, (0, 0, 0, 60)), # Outer shadow
320-
(6, 6, (0, 0, 0, 80)), # Middle shadow
302+
(8, 8, (0, 0, 0, 60)), # Outer shadow
303+
(6, 6, (0, 0, 0, 80)), # Middle shadow
321304
(4, 4, (0, 0, 0, 100)), # Inner shadow
322305
(2, 2, (0, 0, 0, 140)), # Close shadow
323306
]
@@ -400,8 +383,13 @@ def create_iphone_screenshot(raw_path, marketing_info, output_size, variant=0):
400383
sub_x = (width - sub_width) // 2
401384
sub_y = text_y + total_text_height + int(height * 0.02)
402385
draw_text_with_glow(
403-
bg, (sub_x, sub_y), subheadline, sub_font,
404-
fill=(220, 230, 255), glow_radius=10, accent_glow=False,
386+
bg,
387+
(sub_x, sub_y),
388+
subheadline,
389+
sub_font,
390+
fill=(220, 230, 255),
391+
glow_radius=10,
392+
accent_glow=False,
405393
)
406394

407395
return bg.convert("RGB")
@@ -481,8 +469,13 @@ def create_mac_screenshot(raw_path, marketing_info, output_size, variant=0):
481469
sub_font = get_font(sub_font_size, style="body")
482470
sub_y = text_y + len(lines) * int(headline_font_size * 1.2) + 30
483471
draw_text_with_glow(
484-
bg, (text_x, sub_y), subheadline, sub_font,
485-
fill=(220, 230, 255), glow_radius=12, accent_glow=False,
472+
bg,
473+
(text_x, sub_y),
474+
subheadline,
475+
sub_font,
476+
fill=(220, 230, 255),
477+
glow_radius=12,
478+
accent_glow=False,
486479
)
487480

488481
return bg.convert("RGB")

0 commit comments

Comments
 (0)