Skip to content

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

Swyddogaeth: getLogoDataUri() ​

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

Bêta

Cael logo fel URI data:image/svg+xml base64.

Paramedrau ​

product ​

Product

Y cynnyrch.

layout? ​

LogoLayout = "horizontal"

Y trefniant (diofyn "horizontal").

colorMode? ​

LogoColorMode = "full-color"

Y driniaeth lliw (diofyn "full-color").

lang? ​

LogoLang

Iaith marc geiriau lleol, os dymunir amrywiad wedi'i gyfieithu.

Yn dychwelyd ​

string | undefined

Y URI data, neu undefined os nad yw'r cyfuniad hwnnw yn bodoli.

Enghraifft ​

Defnyddiwch logo fel 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;