@bimatrix-aud-platform/aud_mcp_server 1.1.70 → 1.1.72
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.
|
@@ -5,6 +5,29 @@
|
|
|
5
5
|
* 간소화된 .design.json 형태로 변환합니다.
|
|
6
6
|
*/
|
|
7
7
|
import { defaultStyle, defaultDocking, defaultValidator, ELEMENT_DEFAULTS_MAP, } from "./defaults.js";
|
|
8
|
+
import { rgbaToHex } from "../utils/color.js";
|
|
9
|
+
// ============================================
|
|
10
|
+
// Color 변환 유틸
|
|
11
|
+
// ============================================
|
|
12
|
+
/** Color 객체({R,G,B,A})를 hex 문자열로 변환 */
|
|
13
|
+
function colorToHex(color) {
|
|
14
|
+
if (color && typeof color === "object" && color.R !== undefined && color.G !== undefined && color.B !== undefined) {
|
|
15
|
+
return rgbaToHex(color);
|
|
16
|
+
}
|
|
17
|
+
return color;
|
|
18
|
+
}
|
|
19
|
+
/** Style 내 Background.Color, Border.Color, Font.Color를 hex 문자열로 변환 */
|
|
20
|
+
function convertStyleColorsToHex(style) {
|
|
21
|
+
if (style.Background && style.Background.Color) {
|
|
22
|
+
style.Background.Color = colorToHex(style.Background.Color);
|
|
23
|
+
}
|
|
24
|
+
if (style.Border && style.Border.Color) {
|
|
25
|
+
style.Border.Color = colorToHex(style.Border.Color);
|
|
26
|
+
}
|
|
27
|
+
if (style.Font && style.Font.Color) {
|
|
28
|
+
style.Font.Color = colorToHex(style.Font.Color);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
8
31
|
// ============================================
|
|
9
32
|
// 공통 유틸
|
|
10
33
|
// ============================================
|
|
@@ -123,6 +146,10 @@ export function compactElement(element) {
|
|
|
123
146
|
result.Style = compactStyle;
|
|
124
147
|
}
|
|
125
148
|
}
|
|
149
|
+
// Style 내 Color 객체를 hex 문자열로 변환
|
|
150
|
+
if (result.Style) {
|
|
151
|
+
convertStyleColorsToHex(result.Style);
|
|
152
|
+
}
|
|
126
153
|
// Visible: true(기본값)이면 제거
|
|
127
154
|
if (element.Visible === false) {
|
|
128
155
|
result.Visible = false;
|