Skip to content

pantoken / plugins/pantoken/logos/src / getLogoDataUri

Funktion: getLogoDataUri()

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

Beta

Erhalte ein Logo als base64 data:image/svg+xml-URI.

Parameter

product

Product

Das Produkt.

layout?

LogoLayout = "horizontal"

Das Layout (Standard: "horizontal").

colorMode?

LogoColorMode = "full-color"

Die Farbgestaltung (Standard: "full-color").

lang?

LogoLang

Die Sprache der lokalisierten Wortmarke, falls eine übersetzte Variante gewünscht ist.

Rückgabe

string | undefined

Die Daten-URI oder undefined, falls diese Kombination nicht existiert.

Beispiel

Verwende ein Logo als <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;