本文へ移動

Hata旗

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

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

目次

リファレンス · 旗の資料と表示の情報

FramingCrop型

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

The crop of a flag at one shape: which crop fit: "auto" chooses, and the side fit: "crop" asked for by name keeps. Both the whole flag and a crop are offered for every flag: fit: "whole" shows all of it, fit: "crop" crops it.

インポート

import type { FramingCrop } from "@johnmorrisdotca/hata/manifest";

定義

interface FramingCrop {
    rule: "own" | "curated" | "centre" | "whole";
    at: "left" | "right" | "top" | "bottom" | "centre";
    why: string | null;
    loses: string[];
}

メンバー

名前型説明
rule"whole" | "own" | "curated" | "centre"

What auto does: own (the flag is this shape, so there is nothing to crop), curated (a crop kept at at, chosen by hand and checked), centre (a crop from the centre that keeps every colour) or whole (no crop shows the flag fairly, so auto shows all of it).

at"centre" | "left" | "right" | "top" | "bottom"

The side fit: "crop" keeps: left (the hoist), right, top, bottom, or centre where nobody chose another.

whystring | null

Why a person chose this side, or chose to show the flag whole; null where nobody chose (a centre crop, or a flag that is already this shape).

losesstring[]

The colours (each covering 5% or more of the flag) that a crop at at drops: empty where it keeps them all, and explained in why where rule is curated.

例

import { manifest, type FramingCrop } from "@johnmorrisdotca/hata/manifest";

const crop: FramingCrop | undefined = manifest("US-HI")?.framings["1:1"].crop;
console.log(crop?.rule); // "curated": a person chose the side
console.log(crop?.at);   // "left": the canton and the stripes beside it
curated
left

出力(このページを作ったときに実行した結果)

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

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