Add world settings command and related files

This commit is contained in:
2026-03-31 05:09:15 +02:00
parent 9c7dbd9a1e
commit ac0bff3909
3 changed files with 196 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import type { CSSProperties } from "react";
import type { WorldBackgroundSettings } from "../document/world-settings";
export function createWorldBackgroundStyle(background: WorldBackgroundSettings): CSSProperties {
if (background.mode === "solid") {
return {
backgroundColor: background.colorHex,
backgroundImage: "none"
};
}
return {
backgroundColor: background.bottomColorHex,
backgroundImage: `linear-gradient(180deg, ${background.topColorHex} 0%, ${background.bottomColorHex} 100%)`
};
}