replace RecolorOptions with DollColorSchemeDto
This commit is contained in:
@@ -1,24 +1,18 @@
|
||||
import { commands } from "$lib/bindings";
|
||||
import { commands, type DollColorSchemeDto } from "$lib/bindings";
|
||||
import onekoGif from "../../assets/oneko/oneko.gif";
|
||||
|
||||
export interface RecolorOptions {
|
||||
bodyColor: string;
|
||||
outlineColor: string;
|
||||
applyTexture?: boolean;
|
||||
}
|
||||
|
||||
export async function getSpriteSheetUrl(
|
||||
options?: RecolorOptions,
|
||||
options?: DollColorSchemeDto,
|
||||
): Promise<string> {
|
||||
if (!options || !options.bodyColor || !options.outlineColor) {
|
||||
if (!options) {
|
||||
return onekoGif;
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await commands.recolorGifBase64(
|
||||
options.bodyColor,
|
||||
options.outlineColor,
|
||||
options.applyTexture ?? true,
|
||||
options.body,
|
||||
options.outline,
|
||||
true, // TODO: default true for now, will add customization in the future
|
||||
);
|
||||
return `data:image/gif;base64,${result}`;
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user