1.4 KiB · text History af1c436
//! Re-renders the five cbz app icons with the reconstructed studio, for
//! eyeball comparison against the originals.

use icon_studio::palette::NamedColor;
use icon_studio::render;
use icon_studio::spec::{Background, Foreground, IconSpec};

fn main() {
    let teal = NamedColor {
        role: "primary",
        rgb: [0x00, 0xC9, 0xD4],
    };
    let green = NamedColor {
        role: "accent",
        rgb: [0xAA, 0xD4, 0x00],
    };
    let ink = NamedColor {
        role: "base-200",
        rgb: [0x0D, 0x2A, 0x2C],
    };

    // Glyph choices read off the shipped icons.
    let apps: &[(&str, Foreground)] = &[
        ("cbzauth", Foreground::Icon('\u{e899}')),  // lock
        ("cbzlists", Foreground::Icon('\u{e85d}')), // assignment
        ("cbznumerics", Foreground::Text("1234".into())),
        ("cbzscanner", Foreground::Icon('\u{eb3a}')), // satellite_alt
        ("cbzinventory", Foreground::Icon('\u{e1a1}')), // inventory_2
    ];

    for (name, fg) in apps {
        let spec = IconSpec {
            foreground: fg.clone(),
            fg_color: ink,
            bg_a: teal,
            bg_b: green,
            background: Background::DiagonalSplit,
            angle: 45.0,
            scale: 0.58,
            ..Default::default()
        };
        let pm = render::render_composed(&spec, 432);
        let out = format!("/tmp/claude-1000/repro_{name}.png");
        pm.save_png(&out).unwrap();
        println!("{out}");
    }
}