Implement oklab, oklch color space conversion functions, add example, restructure comments in the shaderlib, implements #37
This commit is contained in:
parent
35959290d3
commit
1a21589fc1
8 changed files with 127 additions and 34 deletions
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
// Alpha Blending a over b after Bruce A. Wallace
|
||||
// source: https://en.wikipedia.org/wiki/Alpha_compositing
|
||||
/*
|
||||
Alpha Blending a over b after Bruce A. Wallace
|
||||
source: https://en.wikipedia.org/wiki/Alpha_compositing
|
||||
*/
|
||||
vec4 alpha_blend(vec4 b, vec4 a) {
|
||||
float alpha = a.a + (b.a * (1.0 - a.a));
|
||||
vec3 col = ((a.rgb*a.a) + ((b.rgb*b.a) * (1.0 - a.a)) / alpha);
|
||||
|
|
|
|||
Reference in a new issue