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

Function withAlpha

packages/ui/src/theme/color.ts:296–299  ·  view source on GitHub ↗
(color: HexColor, alpha: number)

Source from the content-addressed store, hash-verified

294}
295
296export function withAlpha(color: HexColor, alpha: number): string {
297 const { r, g, b } = hexToRgb(color)
298 return `rgba(${Math.round(r * 255)}, ${Math.round(g * 255)}, ${Math.round(b * 255)}, ${alpha})`
299}

Callers 4

terminal.tsxFile · 0.90
getTerminalColorsFunction · 0.90
alphaToneFunction · 0.90
resolveThemeVariantFunction · 0.90

Calls 1

hexToRgbFunction · 0.70

Tested by

no test coverage detected