Skip to content

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

Fonction: getLogoDataUri() ​

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

Bêta

Obtenir un logo en tant qu'URI base64 data:image/svg+xml.

Paramètres ​

product ​

Product

Le produit.

layout? ​

LogoLayout = "horizontal"

La disposition (par défaut "horizontal").

colorMode? ​

LogoColorMode = "full-color"

Le traitement des couleurs (par défaut "full-color").

lang? ​

LogoLang

La langue du logotype localisé, si une variante traduite est souhaitée.

Renvoie ​

string | undefined

L'URI de données, ou undefined si cette combinaison n'existe pas.

Exemple ​

Utiliser un logo comme src <img>

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

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