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 · Medieval banners

medievalAspectfunction

A banner's width over its height, from its viewBox: 1.5 for the arms of Aragon's 3 to 2. For keeping a box before the picture is drawn.

Import it

import { medievalAspect } from "@johnmorrisdotca/hata/medieval";

Definition

function medievalAspect(id: string): number | null

Parameters

NameTypeDescription
idstring

A banner's id, in any case, with or without med:.

Returns

number | null

The aspect ratio, or null when the set has no such banner.

Examples

import { medievalAspect } from "@johnmorrisdotca/hata/medieval";

console.log(medievalAspect("med:aragon-pallets")); // 1.5
console.log(medievalAspect("med:scotland-saltire")); // 1.6666666666666667
1.5
1.6666666666666667

What it prints (run when this page was built)

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