MCPcopy Create free account
hub / github.com/VCVRack/Rack / screen

Function screen

src/color.cpp:54–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54NVGcolor screen(NVGcolor a, NVGcolor b) {
55 if (a.a == 0.f)
56 return b;
57 if (b.a == 0.f)
58 return a;
59
60 a = mult(a, a.a);
61 b = mult(b, b.a);
62 NVGcolor c = minus(plus(a, b), mult(a, b));
63 c.a = a.a + b.a - a.a * b.a;
64 c = mult(c, 1.f / c.a);
65 c = clamp(c);
66 return c;
67}
68
69NVGcolor alpha(NVGcolor a, float alpha) {
70 a.a *= alpha;

Callers 2

setBrightnessesMethod · 0.85
colorScreenFunction · 0.85

Calls 4

multFunction · 0.85
minusFunction · 0.85
plusFunction · 0.85
clampFunction · 0.70

Tested by

no test coverage detected