Skip to content

pantoken-root / plugins/pantoken/logos/src / getLogoMeta

Mahi: getLogoMeta() ​

getLogoMeta(product, layout?, colorMode?, lang?): LogoMeta | undefined

Beta

Tirohia ngā metadata o tētahi tohu, tae atu ki te width/height PNG kua whakamahia hei rārangi pikitia — mō ngā kaihoko e hiahia ana ki te hanga ara dist/<name>.png (hei tauira ma @pantoken/cdn)) rānei ki te ine i tētahi <img> me te kore e wetewete i te SVG.

Ngā Tawhā ​

product ​

Product

Te hua.

layout? ​

LogoLayout = "horizontal"

Te whakatakotoranga (taunoa "horizontal").

colorMode? ​

LogoColorMode = "full-color"

Te maimoatanga tae (taunoa "full-color").

lang? ​

LogoLang

Te reo o te kupu tohu ā-rohe, mēnā e hiahiatia ana tētahi waahanga kua whakamaoritia.

Whakahokia ​

LogoMeta | undefined

Te aho SVG, ranei undefined mēnā kāore tērā huinga e wātea.

Tauira ​

Read a logo's aspect ratio

ts
import { getLogoMeta } from "@pantoken/plugin-logos";

const meta = getLogoMeta("canvas", "horizontal", "color");
meta && meta.width / meta.height; // the logo's real aspect ratio