From 426d52d8c1394bf0452d19f8d3534dfe11ad8214 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 14 Sep 2021 16:59:09 -0600 Subject: [PATCH] Mix quad border color with background color based on its alpha channel Co-Authored-By: Max Brunsfeld --- gpui/src/platform/mac/shaders/shaders.metal | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gpui/src/platform/mac/shaders/shaders.metal b/gpui/src/platform/mac/shaders/shaders.metal index 00338b30e7..13d2720fad 100644 --- a/gpui/src/platform/mac/shaders/shaders.metal +++ b/gpui/src/platform/mac/shaders/shaders.metal @@ -70,9 +70,10 @@ float4 quad_sdf(QuadFragmentInput input) { if (border_width == 0.) { color = input.background_color; } else { + float4 border_color = float4(mix(float3(input.background_color), float3(input.border_color), input.border_color.a), 1.); float inset_distance = distance + border_width; color = mix( - input.border_color, + border_color, input.background_color, saturate(0.5 - inset_distance) );