MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / compileTheme

Function compileTheme

packages/core/src/theme/theme.ts:207–220  ·  view source on GitHub ↗
(themeDefinition: ThemeDefinition)

Source from the content-addressed store, hash-verified

205}
206
207export function compileTheme(themeDefinition: ThemeDefinition): Theme {
208 const validated = validateTheme(themeDefinition);
209 const cached = compiledThemeCache.get(validated);
210 if (cached) return cached;
211
212 const compiled = Object.freeze({
213 definition: validated,
214 colors: buildColorIndex(validated),
215 spacing: buildSpacing(validated.spacing),
216 focusIndicator: Object.freeze({ ...validated.focusIndicator }) as FocusIndicatorTokens,
217 });
218 compiledThemeCache.set(validated, compiled);
219 return compiled;
220}
221
222export function blendTheme(from: Theme, to: Theme, t: number): Theme {
223 const clampedT = Math.max(0, Math.min(1, t));

Calls 5

validateThemeFunction · 0.85
buildColorIndexFunction · 0.85
buildSpacingFunction · 0.85
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected