INNER CODE UNIT · Python
ease_t
dddevid/Musly · tools/generate_dmg_background.py:31
ease_t = 0.5 - 0.5 * math.cos(t * math.pi)
r = int(20 + (10 - 20) * ease_t)
g = int(22 + (11 - 22) * ease_t)
b = int(32 + (16 - 32) * ease_t)
for x in range(w):
idx = (y * w + x) * 4
img[idx] = r
img[idx + 1] = g
img[idx + 2] = b
img[idx + 3] = 255
# 2. Ambient radial glow in the center behind the arrow
cx, cy = w // 2, 190
glow_rx = 180
glow_ry = 120
for y in range(max(0, cy - glow_ry), min(h, cy + glow_ry)):
for x in range(max(0, cx - glow_rx), min(w, cx + glow_rx)):
dx = (x - cx) / glow_rx