Skip to content

pantoken-root / plugins/pantoken/logos/src / getLogoDataUri

Fungsi: getLogoDataUri() ​

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

Beta

Dapatkan logo sebagai URI base64 data:image/svg+xml.

Parameter ​

product ​

Product

Produk.

layout? ​

LogoLayout = "horizontal"

Susun atur (lalai "horizontal").

colorMode? ​

LogoColorMode = "full-color"

Rawatan warna (lalai "full-color").

lang? ​

LogoLang

Bahasa wordmark yang dilokalkan, jika varian terjemahan dikehendaki.

Mengembalikan ​

string | undefined

URI data, atau undefined jika gabungan itu tidak wujud.

Contoh ​

Gunakan logo sebagai <img> src

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

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