Reference
Flags by their colours
import { … } from "@johnmorrisdotca/hata/search";
23.1 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
COLOUR_NAMES | constant | The 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. |
ColourName | type | The names a flag's colour can have: a closed list of the words a person uses of a flag ("red, white and blue"). |
coloursOf | function | A 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_TAGS | constant | The 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. |
FlagColour | type | One 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). |
flagsWith | function | The flags that have every colour and every tag asked for. |
FlagTag | type | One thing that is on a flag, and where the claim comes from. |
TAG_SOURCES | constant | Where 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). |
TagName | type | The names a flag's tag can have: a closed list of the things a person sees on a flag. |
tagsOf | function | What is on a flag, as tags from the closed list, each with where it comes from. |
TagSource | type | Where a tag comes from, the most trusted first. |