mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 21:32:40 +00:00
Mix quad border color with background color based on its alpha channel
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
parent
b63b717eac
commit
426d52d8c1
1 changed files with 2 additions and 1 deletions
|
@ -70,9 +70,10 @@ float4 quad_sdf(QuadFragmentInput input) {
|
||||||
if (border_width == 0.) {
|
if (border_width == 0.) {
|
||||||
color = input.background_color;
|
color = input.background_color;
|
||||||
} else {
|
} 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;
|
float inset_distance = distance + border_width;
|
||||||
color = mix(
|
color = mix(
|
||||||
input.border_color,
|
border_color,
|
||||||
input.background_color,
|
input.background_color,
|
||||||
saturate(0.5 - inset_distance)
|
saturate(0.5 - inset_distance)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue