Skip to the content

Hata旗

Load a native country or region flag, choose supported framing and keep each drawing’s source, author and licence.

Hata (旗) is Japanese for a flag. About the name

Contents

Reference

Flags by their colours

import { … } from "@johnmorrisdotca/hata/search";

23.1 kB minified and gzipped, with everything it imports (measured with esbuild)

Exports

NameKindWhat it is
COLOUR_NAMESconstantThe names a flag's colour can have, in the order a colour picker shows them: a closed list, so a page can draw a chip for each.
ColourNametypeThe names a flag's colour can have: a closed list of the words a person uses of a flag ("red, white and blue").
coloursOffunctionA flag's colours, the one that covers most of it first: each an exact hex as the drawing has it, the share of the flag it covers and its name.
FLAG_TAGSconstantThe names a flag's tag can have, in the order tagsOf gives them: a closed list, so a page can draw a chip for each.
FlagColourtypeOne colour of a flag, measured from the shipped drawing (the flag's own, never a frame or a crop) drawn 1200 pixels wide: every pixel counted by its exact colour, the smoothed edges and the steps of a gradient given to the nearest colour that covers at least 0.1% of the flag (pnpm data:colours, scripts/colours.mjs).
flagsWithfunctionThe flags that have every colour and every tag asked for.
FlagTagtypeOne thing that is on a flag, and where the claim comes from.
TAG_SOURCESconstantWhere a tag can come from, the most trusted first: reviewed (a person looked), computed (measured from the drawing with no judgement), wikidata (the flag's Wikidata item says so) and unreviewed (an automated guess nobody has checked).
TagNametypeThe names a flag's tag can have: a closed list of the things a person sees on a flag.
tagsOffunctionWhat is on a flag, as tags from the closed list, each with where it comes from.
TagSourcetypeWhere a tag comes from, the most trusted first.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hata 1.31.0.