本文へ移動

Hata旗

国や地域の旗を読み込み、対応する表示の形を選び、絵ごとの資料・作者・ライセンスを保てます。

「旗(はた)」は、旗を表す日本語です。 名前について(英語)

目次

リファレンス

色で旗を探す

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

最小化と gzip 圧縮をしたサイズは 23.1 kB(読み込むものをすべて含み、esbuild で計測)

リファレンスの説明と例は英語です。見出しと目次は日本語です。

エクスポート

名前種類概要
COLOUR_NAMES定数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型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関数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定数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型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関数The flags that have every colour and every tag asked for.
FlagTag型One thing that is on a flag, and where the claim comes from.
TAG_SOURCES定数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型The names a flag's tag can have: a closed list of the things a person sees on a flag.
tagsOf関数What is on a flag, as tags from the closed list, each with where it comes from.
TagSource型Where a tag comes from, the most trusted first.

ソースを見るGitHub で編集@johnmorrisdotca/hata 1.31.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。