INNER CODE UNIT · Python
width
utopia-rise/godot-jvm · logo/export.py:186
width = int(pad_x * 2 + icon_box + icon_gap + fnt.getlength(label))
badge = Image.new('RGBA', (width, height), (0, 0, 0, 0))
draw = ImageDraw.Draw(badge)
draw.rounded_rectangle((0, 0, width - 1, height - 1), radius=height // 2,
fill=(130, 100, 240, 42), outline=(165, 140, 255, 170), width=3)
badge.alpha_composite(white, (pad_x + (icon_box - white.width) // 2, (height - white.height) // 2))
draw.text((pad_x + icon_box + icon_gap, height / 2 + 2), label, font=fnt, fill=(244, 245, 255, 255), anchor='lm')
row.alpha_composite(badge, (x, 0))
x += width + gap
return row.crop((0, 0, x - gap, height))
def background(accent_x, accent_y, accent_radius=640):
top, bottom = (18, 14, 48), (8, 6, 24)
bg = Image.new('RGB', (CANVAS_W, CANVAS_H))
draw = ImageDraw.Draw(bg)
for y in range(CANVAS_H):
t = y / CANVAS_H
draw.line((0, y, CANVAS_W, y), fill=tuple(int(top[i] * (1 - t) + bottom[i] * t) for i in range(3)))