agenthub/frontend/lib/office-palette.ts

171 lines
4.6 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use client";
// 办公室画布的房间调色板:同一个场景,暗色是"夜里的办公室",亮色是"白天的办公室"。
//
// 只覆盖"环境"——墙、地板、窗外的天色、机柜、看板纸面、投影阴影。人和家具(工装、
// 头发、沙发、吧台、绿植)在两套主题下保持一致:那是"谁/什么东西"的颜色,不是
// 环境光,跟着主题改反而认不出人。
//
// 画布不读 CSS 变量(它是 canvas,不是 DOM),所以主题名在这里再映射一次;属性名
// 与调用点一一对应,改配色只需要动这张表。亮色只写覆盖项,键仍来自暗色那套。
import type { Theme } from "./theme";
export interface OfficePalette {
/** 墙面三段 + 画框/边框通用色。 */
wall: string;
wallHi: string;
wallLo: string;
trim: string;
/** 窗外的天色:夜里有星有月,白天换成云和太阳。 */
sky: string;
skyBand: string;
star: string;
moon: string;
moonShade: string;
buildingFar: string;
buildingNear: string;
windowLit: string;
sill: string;
sillEdge: string;
/** 挂钟。 */
clockFace: string;
clockFaceHi: string;
clockHour: string;
clockMinute: string;
/** 木地板。 */
floorBase: string;
floorTintA: string;
floorTintB: string;
floorTintC: string;
floorGrain: string;
floorEdge: string;
/** 踩出来的通道。 */
wear: string;
/** 机柜:金属柜体 + 里面的槽位。 */
rackFrame: string;
rackEdge: string;
rackInner: string;
rackPanel: string;
rackPanelHi: string;
rackSlot: string;
rackScreen: string;
/** 看板:纸面 + 墨色 + 表头条。 */
boardPaper: string;
boardPaperHi: string;
boardRule: string;
boardInk: string;
boardMuted: string;
boardLabel: string;
boardHeader: string;
boardHeaderInk: string;
/** 工位名牌。 */
plateBg: string;
plateInk: string;
/** 阴影与暗角:色相不变,只换基色和浓度。 */
shadowRGB: string;
vignetteRGB: string;
vignetteAlpha: number;
}
/** 暗色 = 一直以来的夜景配色,数值原样保留:换主题不该让夜景变样。 */
export const OFFICE_DARK: OfficePalette = {
wall: "#40392e",
wallHi: "#4a4235",
wallLo: "#332d24",
trim: "#5a4c37",
sky: "#22384c",
skyBand: "#2c4761",
star: "#cfe0ee",
moon: "#efe6c4",
moonShade: "#d8cca2",
buildingFar: "#1b2b3b",
buildingNear: "#16242f",
windowLit: "#f2d98a",
sill: "#6b5a41",
sillEdge: "#4a3c2b",
clockFace: "#e6e0d2",
clockFaceHi: "#f2ece0",
clockHour: "#4a4238",
clockMinute: "#c2685a",
floorBase: "#6d5540",
floorTintA: "#7b6049",
floorTintB: "#735941",
floorTintC: "#82674d",
floorGrain: "#684f39",
floorEdge: "#624b35",
wear: "rgba(233,206,160,0.05)",
rackFrame: "#232830",
rackEdge: "#4a5462",
rackInner: "#191d24",
rackPanel: "#3a424f",
rackPanelHi: "#4b5666",
rackSlot: "#3d434d",
rackScreen: "#4b4740",
boardPaper: "#e7e0d2",
boardPaperHi: "rgba(255,255,255,0.55)",
boardRule: "#b9b1a2",
boardInk: "#1b1812",
boardMuted: "#8a8175",
boardLabel: "#4f4737",
boardHeader: "#1b1812",
boardHeaderInk: "#c9a227",
plateBg: "rgba(24,21,17,0.9)",
plateInk: "#e9e3d7",
shadowRGB: "16,12,8",
vignetteRGB: "20,14,8",
vignetteAlpha: 0.42,
};
/** 亮色 = 白天的同一间办公室:暖纸墙、浅木地板、窗外是白天的楼和云。 */
export const OFFICE_LIGHT: OfficePalette = {
...OFFICE_DARK,
wall: "#e3d8bf",
wallHi: "#f0e7d2",
wallLo: "#d2c3a4",
trim: "#b6a17a",
sky: "#bcd9ef",
skyBand: "#d4e8f8",
star: "#ffffff",
moon: "#ffd98a",
moonShade: "#f0c476",
buildingFar: "#aabdcf",
buildingNear: "#90a6ba",
windowLit: "#e9f2fa",
sill: "#c2ab82",
sillEdge: "#a89065",
clockFace: "#f5f0e3",
clockFaceHi: "#fffdf6",
clockHour: "#5a5147",
floorBase: "#d8b487",
floorTintA: "#e2bf93",
floorTintB: "#dab78a",
floorTintC: "#ebc99e",
floorGrain: "#c9a271",
floorEdge: "#bc9563",
wear: "rgba(255,247,226,0.28)",
rackFrame: "#aab2bb",
rackEdge: "#89919b",
rackInner: "#6f767e",
rackPanel: "#c3cad2",
rackPanelHi: "#d6dce3",
rackSlot: "#8b939c",
rackScreen: "#dfe6ec",
boardPaper: "#fdf8ec",
boardPaperHi: "rgba(255,255,255,0.85)",
boardRule: "#cfc3a6",
boardInk: "#2f2822",
boardMuted: "#8d8271",
boardLabel: "#5f5644",
boardHeader: "#3b332a",
boardHeaderInk: "#ffd98a",
plateBg: "rgba(253,248,236,0.94)",
plateInk: "#2f2822",
shadowRGB: "120,96,62",
vignetteRGB: "150,118,74",
vignetteAlpha: 0.22,
};
export const officePalette = (theme: Theme): OfficePalette =>
theme === "light" ? OFFICE_LIGHT : OFFICE_DARK;