Skip to content

pantoken / plugins/pantoken/logos/src / getLogoDataUri

Function: getLogoDataUri()

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

Beta

Get a logo as a base64 data:image/svg+xml URI.

Parameters

product

Product

The product.

layout?

LogoLayout = "horizontal"

The layout (default "horizontal").

colorMode?

LogoColorMode = "full-color"

The color treatment (default "full-color").

Returns

string | undefined

The data URI, or undefined if that combination doesn't exist.

Example

Use a logo as an <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;