Skip to content

pantoken / plugins/pantoken/logos/src / getLogoDataUri

함수: getLogoDataUri()

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

베타

로고를 base64 data:image/svg+xml URI로 가져옵니다.

매개변수

product

Product

제품.

layout?

LogoLayout = "horizontal"

레이아웃(기본값 "horizontal").

colorMode?

LogoColorMode = "full-color"

색상 처리(기본값 "full-color").

lang?

LogoLang

번역된 변형을 원할 경우 지역화된 워드마크의 언어.

반환값

string | undefined

데이터 URI 또는 해당 조합이 존재하지 않으면 undefined.

예제

로고를 <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;