MCPcopy Create free account
hub / github.com/anomalyco/opencode / surface

Function surface

packages/ui/src/theme/resolve.ts:53–65  ·  view source on GitHub ↗
(
    seed: HexColor,
    alpha: { base: number; weak: number; weaker: number; strong: number; stronger: number },
  )

Source from the content-addressed store, hash-verified

51 return content(colors.warning, warning)
52 }
53 const surface = (
54 seed: HexColor,
55 alpha: { base: number; weak: number; weaker: number; strong: number; stronger: number },
56 ) => {
57 const base = alphaTone(seed, alpha.base)
58 return {
59 base,
60 weak: alphaTone(seed, alpha.weak),
61 weaker: alphaTone(seed, alpha.weaker),
62 strong: alphaTone(seed, alpha.strong),
63 stronger: alphaTone(seed, alpha.stronger),
64 }
65 }
66 const background = backgroundHex ?? neutral[0]
67 const alphaTone = (color: HexColor, alpha: number) =>
68 overlay ? (withAlpha(color, alpha) as ColorValue) : blend(color, background, alpha)

Callers 1

resolveThemeVariantFunction · 0.85

Calls 1

alphaToneFunction · 0.85

Tested by

no test coverage detected