// hexagonal counters with embedded image and outline const fs = require('fs') function print_hex(output, input, hi, lo, bd) { let image = fs.readFileSync(input).toString('base64') let svg = [] let img_w = 50 let img_h = 58 // 57.735 let svg_w = img_w + 4 let svg_h = img_h + 6 svg.push(``) let iw = img_w / 2 let ih = iw / Math.sqrt(3) let iy = (svg_h - ih * 4) / 2 let ow = img_w / 2 + 2 let oh = ow / Math.sqrt(3) let oy = (svg_h - oh * 4) / 2 svg.push('') svg.push(``) svg.push('') svg.push('') svg.push(``) svg.push('') svg.push(``) svg.push(``) svg.push(``) svg.push(``) svg.push('') fs.writeFileSync(output, svg.join("\n") + "\n") } print_hex("images/castra.svg", "images/castra.png", "#ffffff", "#b2b2b2", "#434343") print_hex("images/quaestor.svg", "images/quaestor.png", "#ffffff", "#b2b2b2", "#434343") print_hex("images/mob.svg", "images/mob.png", "#eaebc7", "#888968", "#323214") print_hex("images/mob_x2.svg", "images/mob_x2.png", "#eaebc7", "#888968", "#323214") print_hex("images/blue_breakaway.svg", "images/blue_breakaway.png", "#d5ffff", "#6e96b6", "#113854") print_hex("images/blue_seat_of_power.svg", "images/blue_seat_of_power.png", "#d5ffff", "#6e96b6", "#113854") print_hex("images/green_breakaway.svg", "images/green_breakaway.png", "#ace48f", "#568837", "#033600") print_hex("images/green_seat_of_power.svg", "images/green_seat_of_power.png", "#ace48f", "#568837", "#033600") print_hex("images/red_breakaway.svg", "images/red_breakaway.png", "#ff5455", "#c00000", "#680000") print_hex("images/red_seat_of_power.svg", "images/red_seat_of_power.png", "#ff5455", "#c00000", "#680000") print_hex("images/yellow_breakaway.svg", "images/yellow_breakaway.png", "#fffe92", "#c3a634", "#553a00") print_hex("images/yellow_seat_of_power.svg", "images/yellow_seat_of_power.png", "#fffe92", "#c3a634", "#553a00")