@agentscope-ai/design 1.0.21 → 1.0.23-beta.1767087061250

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,36 +1,58 @@
1
1
  /**
2
- * 主题生成器 - Theme Generator
2
+ * Theme Generator
3
3
 
4
- * 核心功能:
5
- * 1. 颜色空间转换(HEX/RGB/HSL)
6
- * 2. 颜色调整和生成
7
- * 3. 完整主题配置生成(支持浅色/暗色模式)
4
+ * Generates a complete theme configuration based on input primary color, background color, and text color.
5
+ * Supports both light and dark modes.
8
6
  *
9
- * 设计原则(参考 Radix Colors):
10
- * - 浅色模式:背景 95-99% 亮度,边框 80-90% 亮度,文本 15-25% 亮度
11
- * - 暗色模式:背景 0-10% 亮度,边框使用透明度,文本 85-95% 亮度
12
- * - 状态色和装饰色在暗色模式下使用预设优化值
7
+ * ## Core Features
8
+ * 1. **Color Space Conversion**: HEX RGB ↔ HSL conversions
9
+ * 2. **Color Adjustment and Generation**: Adjust brightness and saturation based on HSL color space
10
+ * 3. **Complete Theme Configuration**: Generates a complete theme configuration object including
11
+ * primary colors, text colors, background colors, border colors, fill colors, status colors,
12
+ * decorative colors, shadows, etc.
13
13
  *
14
- * 生成规则:
15
- * - 主色 (Primary):从输入的主色生成,暗色模式自动调整亮度
16
- * - 背景色系:基于 bgBase 生成,保持色相统一
17
- * - 文本色系:基于 textBase 生成,保持色相统一
18
- * - 边框色系:基于 bgBase 生成,饱和度提高以增强可见度
19
- * - 填充色系:暗色模式基于文本色+透明度,浅色模式基于背景色
20
- * - 状态色/装饰色/阴影:暗色模式使用预设优化值,浅色模式使用配置文件
14
+ * ## Design Principles
15
+ * ### Light Mode
16
+ * - Background: 95-99% lightness
17
+ * - Border: 80-90% lightness
18
+ * - Text: 15-25% lightness
19
+ *
20
+ * ### Dark Mode
21
+ * - Background: 0-10% lightness
22
+ * - Border: Uses transparency to enhance layering
23
+ * - Text: 85-95% lightness
24
+ * - Status colors and decorative colors: Use preset optimized values
25
+ *
26
+ * ## Generation Rules
27
+ * - **Primary Color**: Generated from input primary color, automatically adjusts brightness in dark mode for readability
28
+ * - **Background Color System**: Generated based on bgBase, maintains consistent hue
29
+ * - **Text Color System**: Generated based on textBase, uses transparency to achieve different levels
30
+ * - **Border Color System**: Generated based on bgBase, increases saturation to enhance visibility
31
+ * - **Fill Color System**: Dark mode uses text color + transparency, light mode uses background color
32
+ * - **Status Colors/Decorative Colors/Shadows**: Dark mode uses preset optimized values, light mode uses configuration file
21
33
  */
22
34
  /**
23
- * 生成完整主题
24
- * @param {string} primaryHex - 主色调
25
- * @param {string} bgBaseHex - 背景基础色
26
- * @param {string} textBaseHex - 文本基础色
27
- * @param {boolean} darkMode - 是否为暗色模式
28
- * @returns {Object} 完整的主题配置对象
35
+ * Generates complete theme configuration
36
+ *
37
+ * Generates a complete theme configuration object based on input primary color, background color,
38
+ * text color, and mode (light/dark). The theme configuration includes: primary colors, text colors,
39
+ * background colors, border colors, fill colors, status colors, decorative colors, shadows, etc.
40
+ *
41
+ * @param {Object} props - Theme generation parameters
42
+ * @param {string} props.primaryHex - Primary color HEX value (required)
43
+ * @param {string} [props.bgBaseHex] - Background base color HEX value, uses default if not provided (light: #ffffff, dark: #000000)
44
+ * @param {string} [props.textBaseHex] - Text base color HEX value, uses default if not provided (light: #1a1a1a, dark: #E7E7ED)
45
+ * @param {boolean} [props.darkMode=false] - Whether it is dark mode
46
+ * @returns {Object | null} Complete theme configuration object, returns null if parameters are invalid
29
47
  */
30
48
  interface GenerateThemeProps {
49
+ /** Primary color HEX value */
31
50
  primaryHex: string;
51
+ /** Background base color HEX value */
32
52
  bgBaseHex?: string;
53
+ /** Text base color HEX value */
33
54
  textBaseHex?: string;
55
+ /** Whether it is dark mode */
34
56
  darkMode: boolean;
35
57
  }
36
58
  declare const generateTheme: ({ primaryHex, bgBaseHex, textBaseHex, darkMode, }: GenerateThemeProps) => {
@@ -51,6 +73,7 @@ declare const generateTheme: ({ primaryHex, bgBaseHex, textBaseHex, darkMode, }:
51
73
  colorPrimaryText: any;
52
74
  colorPrimaryTextHover: any;
53
75
  colorPrimaryTextActive: any;
76
+ colorTextOnPrimary: string;
54
77
  colorTextBase: string;
55
78
  colorText: string;
56
79
  colorTextSecondary: string;
@@ -60,7 +83,7 @@ declare const generateTheme: ({ primaryHex, bgBaseHex, textBaseHex, darkMode, }:
60
83
  colorBgBase: string;
61
84
  colorBgContainer: any;
62
85
  colorBgElevated: any;
63
- colorBgLayout: any;
86
+ colorBgLayout: string;
64
87
  colorBgSpotlight: string;
65
88
  colorBgMask: string;
66
89
  colorBorder: any;
@@ -1,33 +1,47 @@
1
1
  // @ts-nocheck
2
2
  /**
3
- * 主题生成器 - Theme Generator
3
+ * Theme Generator
4
4
 
5
- * 核心功能:
6
- * 1. 颜色空间转换(HEX/RGB/HSL)
7
- * 2. 颜色调整和生成
8
- * 3. 完整主题配置生成(支持浅色/暗色模式)
5
+ * Generates a complete theme configuration based on input primary color, background color, and text color.
6
+ * Supports both light and dark modes.
9
7
  *
10
- * 设计原则(参考 Radix Colors):
11
- * - 浅色模式:背景 95-99% 亮度,边框 80-90% 亮度,文本 15-25% 亮度
12
- * - 暗色模式:背景 0-10% 亮度,边框使用透明度,文本 85-95% 亮度
13
- * - 状态色和装饰色在暗色模式下使用预设优化值
8
+ * ## Core Features
9
+ * 1. **Color Space Conversion**: HEX RGB ↔ HSL conversions
10
+ * 2. **Color Adjustment and Generation**: Adjust brightness and saturation based on HSL color space
11
+ * 3. **Complete Theme Configuration**: Generates a complete theme configuration object including
12
+ * primary colors, text colors, background colors, border colors, fill colors, status colors,
13
+ * decorative colors, shadows, etc.
14
14
  *
15
- * 生成规则:
16
- * - 主色 (Primary):从输入的主色生成,暗色模式自动调整亮度
17
- * - 背景色系:基于 bgBase 生成,保持色相统一
18
- * - 文本色系:基于 textBase 生成,保持色相统一
19
- * - 边框色系:基于 bgBase 生成,饱和度提高以增强可见度
20
- * - 填充色系:暗色模式基于文本色+透明度,浅色模式基于背景色
21
- * - 状态色/装饰色/阴影:暗色模式使用预设优化值,浅色模式使用配置文件
15
+ * ## Design Principles
16
+ * ### Light Mode
17
+ * - Background: 95-99% lightness
18
+ * - Border: 80-90% lightness
19
+ * - Text: 15-25% lightness
20
+ *
21
+ * ### Dark Mode
22
+ * - Background: 0-10% lightness
23
+ * - Border: Uses transparency to enhance layering
24
+ * - Text: 85-95% lightness
25
+ * - Status colors and decorative colors: Use preset optimized values
26
+ *
27
+ * ## Generation Rules
28
+ * - **Primary Color**: Generated from input primary color, automatically adjusts brightness in dark mode for readability
29
+ * - **Background Color System**: Generated based on bgBase, maintains consistent hue
30
+ * - **Text Color System**: Generated based on textBase, uses transparency to achieve different levels
31
+ * - **Border Color System**: Generated based on bgBase, increases saturation to enhance visibility
32
+ * - **Fill Color System**: Dark mode uses text color + transparency, light mode uses background color
33
+ * - **Status Colors/Decorative Colors/Shadows**: Dark mode uses preset optimized values, light mode uses configuration file
22
34
  */
23
35
 
24
36
  import themeDataDark from "./bailianDarkTheme.json";
25
37
  import themeData from "./bailianTheme.json";
26
38
 
27
- // ==================== 颜色转换工具函数 ====================
39
+ // ==================== Color Conversion Utility Functions ====================
28
40
 
29
41
  /**
30
- * HEX RGB
42
+ * Converts HEX color value to RGB object
43
+ * @param {string} hex - HEX color value (e.g., '#FF0000' or 'FF0000')
44
+ * @returns {{r: number, g: number, b: number} | null} RGB object, returns null if conversion fails
31
45
  */
32
46
  var hexToRgb = function hexToRgb(hex) {
33
47
  var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
@@ -39,14 +53,22 @@ var hexToRgb = function hexToRgb(hex) {
39
53
  };
40
54
 
41
55
  /**
42
- * RGB HEX
56
+ * Converts RGB values to HEX color string
57
+ * @param {number} r - Red component (0-255)
58
+ * @param {number} g - Green component (0-255)
59
+ * @param {number} b - Blue component (0-255)
60
+ * @returns {string} HEX color string (e.g., '#FF0000')
43
61
  */
44
62
  var rgbToHex = function rgbToHex(r, g, b) {
45
63
  return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).toUpperCase();
46
64
  };
47
65
 
48
66
  /**
49
- * RGB HSL
67
+ * Converts RGB values to HSL object
68
+ * @param {number} r - Red component (0-255)
69
+ * @param {number} g - Green component (0-255)
70
+ * @param {number} b - Blue component (0-255)
71
+ * @returns {{h: number, s: number, l: number}} HSL object (h: 0-360, s: 0-100, l: 0-100)
50
72
  */
51
73
  var rgbToHsl = function rgbToHsl(r, g, b) {
52
74
  var rr = r / 255;
@@ -84,7 +106,11 @@ var rgbToHsl = function rgbToHsl(r, g, b) {
84
106
  };
85
107
 
86
108
  /**
87
- * HSL RGB
109
+ * Converts HSL values to RGB object
110
+ * @param {number} h - Hue (0-360)
111
+ * @param {number} s - Saturation (0-100)
112
+ * @param {number} l - Lightness (0-100)
113
+ * @returns {{r: number, g: number, b: number}} RGB object (r, g, b: 0-255)
88
114
  */
89
115
  var hslToRgb = function hslToRgb(h, s, l) {
90
116
  var hh = h / 360;
@@ -116,10 +142,14 @@ var hslToRgb = function hslToRgb(h, s, l) {
116
142
  };
117
143
  };
118
144
 
119
- // ==================== 颜色调整函数 ====================
145
+ // ==================== Color Adjustment Functions ====================
120
146
 
121
147
  /**
122
- * 调整颜色的亮度和饱和度(相对调整)
148
+ * Adjusts color brightness and saturation relatively
149
+ * @param {string} hex - Original HEX color value
150
+ * @param {number} lightness - Lightness adjustment value (positive for lighter, negative for darker)
151
+ * @param {number} [saturation=0] - Saturation adjustment value (positive to increase, negative to decrease)
152
+ * @returns {string} Adjusted HEX color value
123
153
  */
124
154
  var adjustColor = function adjustColor(hex, lightness) {
125
155
  var saturation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
@@ -133,7 +163,11 @@ var adjustColor = function adjustColor(hex, lightness) {
133
163
  };
134
164
 
135
165
  /**
136
- * 生成指定亮度的颜色(绝对值)
166
+ * Generates a color with specified lightness (absolute value)
167
+ * @param {string} hex - Base HEX color value
168
+ * @param {number} targetLightness - Target lightness value (0-100)
169
+ * @param {number | null} [targetSaturation=null] - Target saturation value (0-100), keeps original saturation if null
170
+ * @returns {string} Generated HEX color value
137
171
  */
138
172
  var generateColorWithLightness = function generateColorWithLightness(hex, targetLightness) {
139
173
  var targetSaturation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
@@ -149,7 +183,11 @@ var generateColorWithLightness = function generateColorWithLightness(hex, target
149
183
  };
150
184
 
151
185
  /**
152
- * 基于基础色生成色阶(保持色相,调整亮度和饱和度)
186
+ * Generates color scale based on base color (maintains hue, adjusts lightness and saturation)
187
+ * @param {string} baseHex - Base HEX color value
188
+ * @param {number} lightness - Target lightness value (0-100)
189
+ * @param {number} [saturationMultiplier=1] - Saturation multiplier (1 to keep original saturation)
190
+ * @returns {string} Generated HEX color value
153
191
  */
154
192
  var generateColorScale = function generateColorScale(baseHex, lightness) {
155
193
  var saturationMultiplier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
@@ -162,15 +200,21 @@ var generateColorScale = function generateColorScale(baseHex, lightness) {
162
200
  return rgbToHex(newRgb.r, newRgb.g, newRgb.b);
163
201
  };
164
202
 
165
- // ==================== 主题生成函数 ====================
203
+ // ==================== Theme Generation Function ====================
166
204
 
167
205
  /**
168
- * 生成完整主题
169
- * @param {string} primaryHex - 主色调
170
- * @param {string} bgBaseHex - 背景基础色
171
- * @param {string} textBaseHex - 文本基础色
172
- * @param {boolean} darkMode - 是否为暗色模式
173
- * @returns {Object} 完整的主题配置对象
206
+ * Generates complete theme configuration
207
+ *
208
+ * Generates a complete theme configuration object based on input primary color, background color,
209
+ * text color, and mode (light/dark). The theme configuration includes: primary colors, text colors,
210
+ * background colors, border colors, fill colors, status colors, decorative colors, shadows, etc.
211
+ *
212
+ * @param {Object} props - Theme generation parameters
213
+ * @param {string} props.primaryHex - Primary color HEX value (required)
214
+ * @param {string} [props.bgBaseHex] - Background base color HEX value, uses default if not provided (light: #ffffff, dark: #000000)
215
+ * @param {string} [props.textBaseHex] - Text base color HEX value, uses default if not provided (light: #1a1a1a, dark: #E7E7ED)
216
+ * @param {boolean} [props.darkMode=false] - Whether it is dark mode
217
+ * @returns {Object | null} Complete theme configuration object, returns null if parameters are invalid
174
218
  */
175
219
 
176
220
  var generateTheme = function generateTheme(_ref) {
@@ -185,7 +229,7 @@ var generateTheme = function generateTheme(_ref) {
185
229
  if (!rgb) return null;
186
230
  var hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);
187
231
 
188
- // 获取背景色和文本色的 RGB HSL
232
+ // Get RGB and HSL values for background and text colors
189
233
  var bgBaseRgb = hexToRgb(resolvedBgBaseHex);
190
234
  var textBaseRgb = hexToRgb(resolvedTextBaseHex);
191
235
  var bgBaseHsl = bgBaseRgb ? rgbToHsl(bgBaseRgb.r, bgBaseRgb.g, bgBaseRgb.b) : {
@@ -194,22 +238,30 @@ var generateTheme = function generateTheme(_ref) {
194
238
  l: darkMode ? 5 : 99
195
239
  };
196
240
 
197
- // 参考 Radix Colors 的色阶系统
198
- // 浅色模式:
199
- // Scale 1-3: 背景色 (95-99% 亮度)
200
- // Scale 6-8: 边框色、填充色 (80-90% 亮度)
201
- // Scale 11-12: 文本色 (15-25% 亮度)
202
- // 暗色模式:
203
- // Scale 1-3: 背景色 (0-10% 亮度)
204
- // Scale 6-8: 边框色、填充色 (带透明度)
205
- // Scale 11-12: 文本色 (85-95% 亮度)
241
+ // Light mode:
242
+ // Scale 1-3: Background colors (95-99% lightness)
243
+ // Scale 6-8: Border colors, fill colors (80-90% lightness)
244
+ // Scale 11-12: Text colors (15-25% lightness)
245
+ // Dark mode:
246
+ // Scale 1-3: Background colors (0-10% lightness)
247
+ // Scale 6-8: Border colors, fill colors (with transparency)
248
+ // Scale 11-12: Text colors (85-95% lightness)
206
249
 
207
- var baseSaturation = Math.max(8, Math.min(hsl.s, 40)); // 主色背景(如 primaryBg)使用低饱和度
208
- var borderSaturation = Math.max(12, Math.min(hsl.s * 0.6, 35)); // 主色边框(如 primaryBorder)使用的饱和度
250
+ // Calculate saturation values related to primary color
251
+ // Primary color background uses low saturation to ensure background is not too vibrant
252
+ var baseSaturation = Math.max(8, Math.min(hsl.s, 40));
253
+ // Primary color border uses medium saturation to enhance visibility
254
+ var borderSaturation = Math.max(12, Math.min(hsl.s * 0.6, 35));
209
255
 
210
- // 生成主色相关的颜色
256
+ // Calculate actual generated primary color (considering dark mode adjustment)
257
+ var actualPrimaryHex = darkMode ? generateColorWithLightness(primaryHex, Math.max(hsl.l - 5, 42), hsl.s * 0.95) : primaryHex;
258
+ // Get actual primary color lightness to determine text on primary color
259
+ var actualPrimaryRgb = hexToRgb(actualPrimaryHex);
260
+ var actualPrimaryHsl = actualPrimaryRgb ? rgbToHsl(actualPrimaryRgb.r, actualPrimaryRgb.g, actualPrimaryRgb.b) : hsl;
261
+
262
+ // Generate complete theme configuration object
211
263
  var theme = {
212
- // 保留边框圆角配置
264
+ // ========== Border Radius Configuration ==========
213
265
  borderRadiusXS: themeData.borderRadiusXS,
214
266
  borderRadiusSM: themeData.borderRadiusSM,
215
267
  borderRadius: themeData.borderRadius,
@@ -217,54 +269,64 @@ var generateTheme = function generateTheme(_ref) {
217
269
  borderRadiusXL: themeData.borderRadiusXL,
218
270
  borderRadiusFull: themeData.borderRadiusFull,
219
271
  wireframe: themeData.wireframe,
220
- // 主色系 - 暗色模式下生成适配的主色
272
+ // ========== Primary Color System ==========
273
+ // Automatically adjusts primary color brightness in dark mode to ensure readability
221
274
  colorPrimary: darkMode ? generateColorWithLightness(primaryHex, Math.max(hsl.l - 5, 42), hsl.s * 0.95) : primaryHex,
222
275
  colorPrimaryHover: darkMode ? generateColorWithLightness(primaryHex, Math.min(hsl.l + 10, 55), hsl.s * 0.95) : adjustColor(primaryHex, hsl.l < 50 ? 10 : -10, 0),
223
276
  colorPrimaryActive: darkMode ? generateColorWithLightness(primaryHex, Math.max(hsl.l - 10, 35), hsl.s * 0.95) : adjustColor(primaryHex, hsl.l < 50 ? -10 : -20, 0),
224
- colorPrimaryBg: darkMode ? generateColorWithLightness(primaryHex, 13, baseSaturation * 0.6) // 暗色模式:深色背景
277
+ colorPrimaryBg: darkMode ? generateColorWithLightness(primaryHex, 13, baseSaturation * 0.6) // Dark mode: dark background (13% lightness)
225
278
  : generateColorWithLightness(primaryHex, 96, baseSaturation * 0.8),
226
- // 浅色模式:浅色背景
279
+ // Light mode: light background (96% lightness)
227
280
  colorPrimaryBgHover: darkMode ? generateColorWithLightness(primaryHex, 13, baseSaturation * 0.6) : generateColorWithLightness(primaryHex, 94, baseSaturation),
228
281
  colorPrimaryBorder: darkMode ? generateColorWithLightness(primaryHex, 17, borderSaturation * 0.8) : generateColorWithLightness(primaryHex, 88, borderSaturation * 0.8),
229
282
  colorPrimaryBorderHover: darkMode ? generateColorWithLightness(primaryHex, 22, borderSaturation) : generateColorWithLightness(primaryHex, 82, borderSaturation),
230
283
  colorPrimaryText: darkMode ? generateColorWithLightness(primaryHex, Math.max(hsl.l - 5, 42), hsl.s * 0.95) : primaryHex,
231
284
  colorPrimaryTextHover: darkMode ? generateColorWithLightness(primaryHex, Math.min(hsl.l + 10, 55), hsl.s * 0.95) : adjustColor(primaryHex, hsl.l < 50 ? 10 : -10, 0),
232
285
  colorPrimaryTextActive: darkMode ? generateColorWithLightness(primaryHex, Math.max(hsl.l - 10, 35), hsl.s * 0.95) : adjustColor(primaryHex, hsl.l < 50 ? -10 : -20, 0),
233
- // 文本颜色 - 基于 textBase 的色相生成(Scale 11-12)
286
+ // Text color displayed on primary color background: automatically selects black or white based on actual primary color lightness
287
+ // Light theme colors (lightness > 50) use black text, dark theme colors (lightness <= 50) use white text
288
+ colorTextOnPrimary: actualPrimaryHsl.l > 50 ? '#000000' : '#ffffff',
289
+ // ========== Text Color System ==========
290
+ // Generated based on textBase hue, uses transparency to achieve different levels
234
291
  colorTextBase: textBaseHex,
235
292
  colorText: "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.88)"),
236
293
  colorTextSecondary: "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.65)"),
237
294
  colorTextTertiary: "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.45)"),
238
295
  colorTextQuaternary: "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.25)"),
239
296
  colorTextWhite: '#fff',
240
- // 背景颜色 - 基于 bgBase 的色相生成 (Scale 1-3)
297
+ // ========== Background Color System ==========
298
+ // Generated based on bgBase hue, maintains consistent hue
241
299
  colorBgBase: bgBaseHex,
242
- colorBgContainer: darkMode ? generateColorScale(bgBaseHex, Math.min(bgBaseHsl.l + 3, 8), 1.2) // 暗色:稍微亮一点 (5-8%)
243
- : generateColorScale(bgBaseHex, Math.min(bgBaseHsl.l + 1, 99), 0.8),
244
- // 浅色:稍微深一点
245
- colorBgElevated: darkMode ? generateColorScale(bgBaseHex, Math.min(bgBaseHsl.l + 3, 8), 1.2) // 暗色:与 container 相同
300
+ colorBgContainer: darkMode ? generateColorScale(bgBaseHex, Math.min(bgBaseHsl.l + hsl.l * 0.08, 12), 1.2) // Dark mode: dynamically adjusts based on primary color lightness (brighter primary = brighter container, max 12% lightness)
301
+ : generateColorScale(bgBaseHex, Math.max(100 - hsl.l * 0.05, 96), 0.8),
302
+ // Light mode: darker primary = grayer container; lighter primary = closer to white (min 96% lightness)
303
+ colorBgElevated: darkMode ? generateColorScale(bgBaseHex, Math.min(bgBaseHsl.l + 3, 8), 1.2) // Dark mode: slightly brighter than container (max 8% lightness)
246
304
  : bgBaseHex,
247
- // 浅色:使用 bgBase 本身
248
- colorBgLayout: darkMode ? generateColorScale(bgBaseHex, Math.min(bgBaseHsl.l + 3, 8), 1.2) // 暗色:与 container 相同
249
- : generateColorScale(bgBaseHex, Math.max(bgBaseHsl.l - 2, 96), 1.2),
250
- // 浅色:稍微深一点
305
+ // Light mode: uses bgBase itself (usually white)
306
+ colorBgLayout: bgBaseHex,
307
+ // Keeps consistent with bgBase
251
308
  colorBgSpotlight: darkMode ? "rgba(".concat(hexToRgb(generateColorScale(bgBaseHex, 28, 1.2)).r, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 28, 1.2)).g, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 28, 1.2)).b, ", 0.85)") : "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.85)"),
252
309
  colorBgMask: darkMode ? "rgba(".concat(bgBaseRgb.r, ", ").concat(bgBaseRgb.g, ", ").concat(bgBaseRgb.b, ", 0.8)") : "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.45)"),
253
- // 边框和填充 - 暗色模式使用透明度,浅色模式使用实色
254
- colorBorder: darkMode ? "rgba(".concat(hexToRgb(generateColorScale(bgBaseHex, 28, 2)).r, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 28, 2)).g, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 28, 2)).b, ", 0.8)") // 暗色:中等亮度 + 透明度
310
+ // ========== Border and Fill Color System ==========
311
+ // Dark mode uses transparency to enhance layering, light mode uses solid colors
312
+ colorBorder: darkMode ? "rgba(".concat(hexToRgb(generateColorScale(bgBaseHex, 28, 2)).r, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 28, 2)).g, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 28, 2)).b, ", 0.8)") // Dark mode: medium lightness (28%) + 80% opacity
255
313
  : generateColorScale(bgBaseHex, 81, 2.5),
256
- // 浅色:实色边框
314
+ // Light mode: solid border (81% lightness)
257
315
  colorBorderSecondary: darkMode ? "rgba(".concat(hexToRgb(generateColorScale(bgBaseHex, 22, 1.8)).r, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 22, 1.8)).g, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 22, 1.8)).b, ", 0.8)") : generateColorScale(bgBaseHex, 88, 2),
258
- colorFill: darkMode ? "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.18)") // 暗色:基于文本色的透明填充
316
+ colorFill: darkMode ? "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.18)") // Dark mode: transparent fill based on text color
259
317
  : generateColorScale(bgBaseHex, 81, 2.5) + '5c',
260
318
  colorFillSecondary: darkMode ? "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.12)") : generateColorScale(bgBaseHex, 81, 2.5) + '33',
261
319
  colorFillTertiary: darkMode ? "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.08)") : generateColorScale(bgBaseHex, 81, 2.5) + '26',
262
320
  colorFillQuaternary: darkMode ? "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.04)") : generateColorScale(bgBaseHex, 81, 2.5) + '1a',
263
- colorFillDisable: darkMode ? generateColorScale(textBaseHex, 55, 0.8) // 暗色:中等亮度的灰色
321
+ colorFillDisable: darkMode ? generateColorScale(textBaseHex, 55, 0.8) // Dark mode: medium lightness gray (55% lightness)
264
322
  : generateColorScale(bgBaseHex, 86, 1.8),
265
- // 链接色 - 暗色模式下生成适配的颜色
323
+ // Light mode: light gray (86% lightness)
324
+
325
+ // ========== Link Color ==========
326
+ // Automatically adjusts brightness in dark mode to ensure readability
266
327
  colorLink: darkMode ? generateColorWithLightness(primaryHex, Math.max(hsl.l - 5, 42), hsl.s * 0.95) : primaryHex,
267
- // 状态色 - 暗色模式下使用预设值
328
+ // ========== Status Colors ==========
329
+ // Dark mode uses preset optimized values, light mode uses values from configuration file
268
330
  colorInfo: darkMode ? themeDataDark.colorInfo : themeData.colorInfo,
269
331
  colorInfoHover: darkMode ? themeDataDark.colorInfoHover : themeData.colorInfoHover,
270
332
  colorInfoText: darkMode ? themeDataDark.colorInfoText : themeData.colorInfoText,
@@ -290,7 +352,8 @@ var generateTheme = function generateTheme(_ref) {
290
352
  colorErrorBgHover: darkMode ? themeDataDark.colorErrorBgHover : themeData.colorErrorBgHover,
291
353
  colorErrorBorder: darkMode ? themeDataDark.colorErrorBorder : themeData.colorErrorBorder,
292
354
  colorErrorBorderHover: darkMode ? themeDataDark.colorErrorBorderHover : themeData.colorErrorBorderHover,
293
- // 装饰色 - 暗色模式下使用预设值
355
+ // ========== Decorative Colors ==========
356
+ // Dark mode uses preset optimized values, light mode uses values from configuration file
294
357
  colorPurple: darkMode ? themeDataDark.colorPurple : themeData.colorPurple,
295
358
  colorPurpleHover: darkMode ? themeDataDark.colorPurpleHover : themeData.colorPurpleHover,
296
359
  colorPurpleBg: darkMode ? themeDataDark.colorPurpleBg : themeData.colorPurpleBg,
@@ -318,7 +381,8 @@ var generateTheme = function generateTheme(_ref) {
318
381
  colorLavender: darkMode ? themeDataDark.colorLavender : themeData.colorLavender || '#A77BFF',
319
382
  colorLavenderHover: darkMode ? themeDataDark.colorLavenderHover : themeData.colorLavenderHover || '#BB99FF',
320
383
  colorLavenderBg: darkMode ? themeDataDark.colorLavenderBg : themeData.colorLavenderBg || 'rgba(226, 212, 255, 0.8)',
321
- // 阴影 - 暗色模式使用预设值
384
+ // ========== Shadows ==========
385
+ // Dark mode uses preset optimized values, light mode uses values from configuration file
322
386
  boxShadow: darkMode ? themeDataDark.boxShadow : themeData.boxShadow,
323
387
  boxShadowSecondary: darkMode ? themeDataDark.boxShadowSecondary : themeData.boxShadowSecondary,
324
388
  boxShadowTertiary: darkMode ? themeDataDark.boxShadowTertiary : themeData.boxShadowTertiary,