MCPcopy Create free account
hub / github.com/ZToolsCenter/ZTools / applyCustomColor

Function applyCustomColor

internal-plugins/setting/src/utils/themeUtils.ts:48–51  ·  view source on GitHub ↗
(color: string)

Source from the content-addressed store, hash-verified

46 * 应用自定义主题色到 CSS 变量。
47 */
48export function applyCustomColor(color: string): void {
49 const adjustedColor = adjustColorForTheme(color)
50 document.documentElement.style.setProperty('--primary-color', adjustedColor)
51}
52
53/**
54 * 应用主题色类名;当主题色为 custom 时同步写入自定义色变量。

Callers 1

applyPrimaryColorFunction · 0.70

Calls 1

adjustColorForThemeFunction · 0.70

Tested by

no test coverage detected