Sublime Forum

Tabs and spaces color modification

#1

Hello,
I have the same question as this one: Whitespace color or transparency
But in 2023, for the build 4166. I am using the default Monokai theme. When whitespaces are shown, they are a bit “too visible”. Is there a way to easily adjust their (and tabs) color, i.e. to change it completely or just add transparency?

I would appreciate all feedback.

0 Likes

#2

That’s controlled by color schemes.

To customize it,

  1. Call UI: Customize Color Scheme from Command Palette
  2. Add "invisibles": "<color>" to globals section.

Example:

{
	"variables": {},
	"globals": {
		"invisibles": "red"
	},
	"rules": []
}
1 Like

#3

Hi and thank you for the answer.
But how to do that specifically for whitespaces (spaces and tabs)?

0 Likes

#4

I am not aware of “invisibles” applying to something else than whitespace.

grafik

If that’s the case, there is no way to specifically change colors for whitespace only.

0 Likes

#5

Ok, I did not understand what was I supposed to do initially, but now I get it. So I have probed the current color for the whitespace characters (also, tabs apply here too) and added one more byte as the alpha channel as MSB (50 here in hex):

// Documentation at https://www.sublimetext.com/docs/color_schemes.html
{
	"variables":
	{
	},
	"globals":
	{
		"invisibles": "#71716B50"
	},
	"rules":
	[
		
	]
}

It works as expected for both spaces and tabs:

image

Thank you very much for help!

1 Like