"""Generate the launcher banner and app icon vector drawables from brand_mark.xml. The mark is copied unchanged; only the background is drawn here: a diagonal light from deep sea-glass (top right) through near-black to a warm tan glow (bottom left), echoing the mark's cool and warm facets, with a soft vignette. Nothing covers the mark's dark aperture. """ import pathlib,re ROOT=pathlib.Path(__file__).resolve().parents[1] DRAWABLE=ROOT/'app/src/main/res/drawable' MARK=re.findall(r']*/>',(DRAWABLE/'brand_mark.xml').read_text()) def color(hex6,alpha):return f'#{round(alpha*255):02X}{hex6}' def gradient(kind,attrs,stops): items=''.join(f'' for o,c in stops) return f'{items}' def tile(width,height,mark_scale,mark_x,mark_y): cx,cy=width/2,height/2;rect=f'M0,0h{width}v{height}h-{width}z' light=gradient('linear',f'android:startX="{width}" android:startY="0" android:endX="0" android:endY="{height}"', [(0,'#FF1B403C'),(.5,'#FF101414'),(1,'#FF30241A')]) vignette=gradient('radial',f'android:centerX="{cx}" android:centerY="{cy}" android:gradientRadius="{width*.62:.1f}"', [(.35,color('000000',0)),(1,color('000000',.45))]) group=f''+''.join(MARK)+'' return ('' f'{light}{vignette}'+group+'\n') (DRAWABLE/'banner.xml').write_text(tile(320,180,1.6,108.8,38.8)) (DRAWABLE/'icon.xml').write_text(tile(108,108,1,22,22)) print('Wrote banner.xml and icon.xml')