Disclosure: I built this. It powers quizbandiere.it, my free flag quiz.
Country datasets are everywhere; flag colors usually aren’t, and when they are they’re hand-written heraldic descriptions. I extract them from the rendered SVG: rasterize at 64×48, classify pixels by hue, merge antialiasing shades, drop anything under 2.5% of the area, then order the result along whichever axis separates the color centroids most. So a vertical tricolor comes out left-to-right and a horizontal one top-to-bottom — Italy is ["verde", "bianco", "rosso"], not sorted by area. Coats of arms and crosses fall back to area order.
I built it to generate believable wrong answers in a quiz. It works well as a similarity key for “which flags get confused with which”.
250 entries (195 independent states, 55 territories): ISO 3166-1 alpha-2/3, official name, capital, region, area, borders, currencies, languages, TLD, calling code, emoji, colors, SVG URL.
- JSON: https://quizbandiere.it/dati/bandiere.json
- CSV: https://quizbandiere.it/dati/bandiere.csv
- Docs: https://quizbandiere.it/dati/
Served with Access-Control-Allow-Origin: *, so it works from a browser. The license and attribution are inside the JSON, not just on the page.
Limitations
- Everything is in Italian, including the color names (
verde,azzurro). - Colors are perceptual, not official. No hex codes, no heraldic terms.
- No flag ratios and no historical flags.
- Derived work: base data is mledoze/countries, I added the Italian layer and the color extraction. Contested names and borders are inherited from upstream, not adjudicated by me.
- Snapshot, not a feed. The
aggiornatofield tells you how stale your copy is.
License: ODbL 1.0 — not a choice, mledoze/countries is ODbL and share-alike. Artwork is lipis/flag-icons (MIT), re-hosted.
Corrections welcome, especially on flags where the color order looks wrong. That’s where my pipeline is most likely to be quietly incorrect.
submitted by /u/Luchil
[link] [comments]