From 272bc5fe891961738271e5fa67e6e02b18260f9c Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Tue, 6 Nov 2018 01:09:44 +0100 Subject: [PATCH] Fix wrong gamma colors when using chroma. --- app/qml/ShaderTerminal.qml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/qml/ShaderTerminal.qml b/app/qml/ShaderTerminal.qml index db6b6db..35a939f 100644 --- a/app/qml/ShaderTerminal.qml +++ b/app/qml/ShaderTerminal.qml @@ -296,13 +296,12 @@ ShaderEffect { txt_color = max(txt_color, txt_blur.rgb * txt_blur.a);" : "") + - "float greyscale_color = rgb2grey(txt_color) + color;" + + "txt_color += fontColor.rgb * color;" + + "float greyscale_color = rgb2grey(txt_color);" + (chromaColor !== 0 ? - - "vec3 mixedColor = mix(fontColor.rgb, txt_color * fontColor.rgb, chromaColor); - vec3 finalBackColor = mix(backgroundColor.rgb, mixedColor, greyscale_color); - vec3 finalColor = mix(finalBackColor, fontColor.rgb, color).rgb;" + "vec3 foregroundColor = mix(fontColor.rgb, txt_color * fontColor.rgb / greyscale_color, chromaColor); + vec3 finalColor = mix(backgroundColor.rgb, foregroundColor, greyscale_color);" : "vec3 finalColor = mix(backgroundColor.rgb, fontColor.rgb, greyscale_color);") +