リファレンス
色で旗を探す
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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。