Sublime Forum

Color of icons in CTRL-R menu

#1

What is determining color of icons in Ctrl+R menu?
I wanted to make my own color scheme for personal use, tried to mess around with Mariana color scheme, but I didn’t get a single source, looks like it comes from several contextes (storage.type, support.function, support.macro, variable.language). For example, I try to set “storage.type” to blue -> icons for structs are blue. Then I set “support.function” to pink, and those same icons for structs become pink. I tried to read docs about those contextes but there are no mentions about that. There’s something I’m missing here, because it does not make sense right now. Can someone help me with that?

0 Likes

#2

If you are referring to the kind icons (the k for example in the following image), then those are defined by a combination of your active theme + color scheme.

.

The theme defines what color is to be used for the kind icons. If you open your Theme - Default/Default.sublime-theme using View Package File from the command palette, then you’d see these at around line 169 (in the latest dev/stable build 4125/4126)

		"kind_function_color": "var(--redish)",
		"kind_keyword_color": "var(--pinkish)",
		"kind_markup_color": "var(--orangish)",
		"kind_namespace_color": "var(--bluish)",
		"kind_navigation_color": "var(--yellowish)",
		"kind_snippet_color": "var(--greenish)",
		"kind_type_color": "var(--purplish)",
		"kind_variable_color": "var(--cyanish)",

These variables are what control the color of the kind icons. So the process of changing them is as simple as using UI: Customize Theme from the command palette and copying the above to the variables section and defining whatever color you like.

Where the color scheme comes into picture is that you can see the certain ish colors (redish, pinkish etc) being used in a default ST setup. Those come from your color scheme. redish just refers to the closest red color among colors defined in your color scheme (and the like for others).

Of course, you can totally bypass the color scheme contribution and just define your own colors, but it’s encouraged to use ish colors so that the kind icons looks good regardless of the scheme used (because it now derives from the color scheme rather than hard coded colors).

Edit: I forgot about one thing. The above variables only make sense if you are using a default ST theme i.e. Default, Default Dark or Adaptive. They probably will not exist on 3rd party themes. For that you will have to consult the theme author/theme docs about customization them.

3 Likes

#3

If you want to know how the scopes are mapped to the symbol kinds, the best source that I’m aware of is at https://github.com/sublimetext-io/docs.sublimetext.io/issues/30.

But since they are not configurable, the description from the post above should be all what is necessary and possible how to adjust the colors for the kind letters.

1 Like

#4

Thank you very much!
I spent whole day confused, but now it’s clear why it was changing the color - yellow was the closest to blue what it could find, I guess :sweat_smile:

0 Likes