MCPcopy Index your code
hub / github.com/anomalyco/opencode / blend

Function blend

packages/opencode/src/cli/cmd/run/theme.ts:175–186  ·  view source on GitHub ↗
(color: RGBA, bg: RGBA)

Source from the content-addressed store, hash-verified

173}
174
175function blend(color: RGBA, bg: RGBA): RGBA {
176 if (color.a >= 1) {
177 return color
178 }
179
180 return RGBA.fromValues(
181 bg.r + (color.r - bg.r) * color.a,
182 bg.g + (color.g - bg.g) * color.a,
183 bg.b + (color.b - bg.b) * color.a,
184 1,
185 )
186}
187
188function chroma(color: RGBA) {
189 return Math.max(color.r, color.g, color.b) - Math.min(color.r, color.g, color.b)

Callers 1

opaqueSyntaxStyleFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected