#!/usr/bin/env python3 """bazaar.abaj.ai favicon — the curved gold diamond ✦ alone, transparent ground. Replaces the orb as the site icon (the orb remains documented on the site's Icons page as an experiment). Same curved-diamond path as the orb's centre. """ import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from matplotlib.path import Path as MPath from matplotlib.patches import PathPatch def curved_diamond(cx, cy, r, waist=0.30): tips = [(cx, cy + r), (cx + r, cy), (cx, cy - r), (cx - r, cy)] verts, codes = [tips[0]], [MPath.MOVETO] for i in range(4): a, b = tips[i], tips[(i + 1) % 4] mx, my = (a[0] + b[0]) / 2, (a[1] + b[1]) / 2 ctrl = (cx + (mx - cx) * waist, cy + (my - cy) * waist) verts += [ctrl, b] codes += [MPath.CURVE3, MPath.CURVE3] return MPath(verts, codes) fig = plt.figure(figsize=(8.5, 8.5), dpi=72) ax = fig.add_axes([0, 0, 1, 1]) ax.set_xlim(-1, 1) ax.set_ylim(-1, 1) ax.set_aspect('equal') ax.axis('off') # soft gold glow behind, then the diamond in the bazaar's gold for r, alpha in [(0.98, 0.05), (0.92, 0.07)]: ax.add_patch(PathPatch(curved_diamond(0, 0, r), fc='#c9a227', ec='none', alpha=alpha)) ax.add_patch( PathPatch(curved_diamond(0, 0, 0.88), fc='#b8860b', ec='#8a6a08', lw=3.0, joinstyle='round') ) fig.savefig('diamond.png', transparent=True, dpi=150) # 1275px master print('wrote diamond.png')