replace RecolorOptions with DollColorSchemeDto

This commit is contained in:
2026-03-09 18:00:05 +08:00
parent 03ae3e0829
commit d582ea7fe8
5 changed files with 35 additions and 42 deletions

View File

@@ -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) {