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 · HK.4X3 flag SVG

svgconstant

The flag of Hong Kong SAR China (中華人民共和国香港特別行政区), HK, drawn again by hand at 4:3 by flag-icons 7.5.0 (MIT), as an SVG string: viewBox 640 by 480, 666 B. The drawing flag("HK", { shape: "4:3" }) uses, made for that shape by hand rather than cut from the flag. The /manifest entry's framings say how each frame was chosen.

Import it

import { svg } from "@johnmorrisdotca/hata/flags/hk.4x3";

Definition

const svg: string = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 480\"><path fill=\"#ec1b2e\" d=\"M0 0h640v480H0\"/><path id=\"hata-hk-4x3-a\" fill=\"#fff\" d=\"M346.3 103.1C267 98 230.6 201.9 305.6 240.3c-26-22.4-20.6-55.3-10.1-72.4l1.9 1.1c-13.8 23.5-11.2 52.7 11.1 71-12.7-12.3-9.5-39 12.1-48.9s23.6-39.3 16.4-49.1q-14.7-25.6 9.3-38.9M307.9 164l-4.7 7.4-1.8-8.6-8.6-2.3 7.8-4.3-.6-8.9 6.5 6.1 8.3-3.3-3.7 8.1 5.6 6.8z\"/><use href=\"#hata-hk-4x3-a\" transform=\"rotate(72 312.5 243.5)\"/><use href=\"#hata-hk-4x3-a\" transform=\"rotate(144 312.5 243.5)\"/><use href=\"#hata-hk-4x3-a\" transform=\"rotate(216 312.5 243.5)\"/><use href=\"#hata-hk-4x3-a\" transform=\"rotate(288 312.5 243.5)\"/></svg>"

Examples

Example 1

import square from "@johnmorrisdotca/hata/flags/hk.4x3";

const host=document.createElement("div");
host.innerHTML = square;
console.log(host.querySelector("svg")?.getAttribute("viewBox"));

Example 2

import { svg } from "@johnmorrisdotca/hata/flags/hk.4x3";
console.log(svg.startsWith("<svg"),svg.length);
true 666

What it prints (run when this page was built)

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