mapcomplete/UI/Img.ts
Pieter Vander Vennet b764371cce Finish refactoring
2020-11-06 04:02:53 +01:00

16 lines
358 B
TypeScript

export class Img {
public static runningFromConsole = false;
static AsData(source:string){
if(this.runningFromConsole){
return source;
}
return `data:image/svg+xml;base64,${(btoa(source))}`;
}
static AsImageElement(source: string): string{
return `<img src="${Img.AsData(source)}">`;
}
}