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
12
examples/oklab.gdshader
Normal file
12
examples/oklab.gdshader
Normal file
|
@ -0,0 +1,12 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
#include "res://shaderlib/colorspaces.gdshaderinc"
|
||||
|
||||
//!load ./images/swamp.jpg
|
||||
|
||||
void fragment() {
|
||||
vec4 oklab = rgb2oklab(COLOR);
|
||||
vec4 oklch = oklab2oklch(oklab);
|
||||
oklch.z -= 2.0;
|
||||
COLOR = oklab2rgb(oklch2oklab(oklch));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue