How to change diff color Visual Studio Code

Updating background color

Since you need to update background only. The only issue in your config earlier was there was no alpha channel specified. You can update it like below

"workbench.colorCustomizations": {
    "diffEditor.removedTextBackground": "#FF000055",
    "diffEditor.insertedTextBackground": "#ffff0055"
}

Where 55 is the alpha channel value. The updated values will have below effect

Updated

Why it’s not possible to natively update text color

The way the diff editor currently works is that it never alters the original text color

It creates an overlay background as can be seen here.

Image class

So basically text renders as it is and the overlay gives the feel that you have a different background.

That is why you can’t control the text color or set a foreground color. This is the limitation of current approach that VSCode/MonacoEditor takes


You can’t control two line colour and char colour separately through normal way. But you can use a custom CSS plugin for VSCode.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)