Skip to content

pantoken / plugins/pantoken/logos/src / getLogoDataUri

Feidhm: getLogoDataUri()

getLogoDataUri(product, layout?, colorMode?, lang?): string | undefined

Béite

Faigh lógó mar URI base64 data:image/svg+xml.

Paraiméadair

product

Product

An táirge.

layout?

LogoLayout = "horizontal"

An leagan amach (réamhshocraithe "horizontal").

colorMode?

LogoColorMode = "full-color"

An chóiriú dathanna (réamhshocraithe "full-color").

lang?

LogoLang

Teanga an mharcfhocail áitiúil, má tá leagan aistrithe uait.

Tuairisceáin

string | undefined

An URI sonraí, nó undefined má níl an teaglaim sin ann.

Sampla

Úsáid lógó mar fhoinse <img>

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

const uri = getLogoDataUri("mastery", "icon", "color");
const img = document.createElement("img");
if (uri) img.src = uri;