Add world settings command and related files
This commit is contained in:
17
src/shared-ui/world-background-style.ts
Normal file
17
src/shared-ui/world-background-style.ts
Normal 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%)`
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user