mirror of
https://github.com/YaLTeR/niri.git
synced 2024-08-17 08:11:00 +03:00
Compare commits
2 Commits
fc22d47b65
...
89d6c622cd
Author | SHA1 | Date | |
---|---|---|---|
|
89d6c622cd | ||
|
31da555f54 |
@ -98,14 +98,15 @@ vec3 oklab_to_linear(vec3 color){
|
||||
|
||||
vec4 color_mix(vec4 color1, vec4 color2, float color_ratio) {
|
||||
// srgb
|
||||
|
||||
if (colorspace == 0.0) {
|
||||
return mix(color1, color2, color_ratio);
|
||||
}
|
||||
|
||||
vec4 color_out;
|
||||
|
||||
color1.rgb /= color1.a;
|
||||
color2.rgb /= color2.a;
|
||||
color1.rgb /= color1.a != 0.0 ? color1.a : 1.0;
|
||||
color2.rgb /= color2.a != 0.0 ? color2.a : 1.0;
|
||||
|
||||
color1.rgb = vec3(
|
||||
srgb_to_linear(color1.r),
|
||||
@ -183,7 +184,7 @@ vec4 color_mix(vec4 color1, vec4 color2, float color_ratio) {
|
||||
}
|
||||
|
||||
return vec4(
|
||||
linear_to_srgb(color_out.r) * color_out.a ,
|
||||
linear_to_srgb(color_out.r) * color_out.a,
|
||||
linear_to_srgb(color_out.g) * color_out.a,
|
||||
linear_to_srgb(color_out.b) * color_out.a,
|
||||
color_out.a
|
||||
|
Loading…
Reference in New Issue
Block a user