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

Function generateNeutralAlphaScale

packages/ui/src/theme/resolve.ts:516–522  ·  view source on GitHub ↗
(neutralScale: HexColor[], isDark: boolean)

Source from the content-addressed store, hash-verified

514}
515
516function generateNeutralAlphaScale(neutralScale: HexColor[], isDark: boolean): HexColor[] {
517 const alphas = isDark
518 ? [0.038, 0.066, 0.1, 0.142, 0.19, 0.252, 0.334, 0.446, 0.58, 0.718, 0.854, 0.985]
519 : [0.03, 0.06, 0.1, 0.145, 0.2, 0.265, 0.35, 0.47, 0.61, 0.74, 0.86, 0.97]
520
521 return alphas.map((alpha) => blend(neutralScale[11], neutralScale[0], alpha))
522}
523
524function getHex(value: ColorValue | undefined): HexColor | undefined {
525 if (!value?.startsWith("#")) return

Callers 1

resolveThemeVariantFunction · 0.85

Calls 1

blendFunction · 0.90

Tested by

no test coverage detected