Sublime Forum

Relationships between Schemes & Color Schemes

#1

OK… brand new, first post here, rode in on the back of a turnip truck.

I’m currently evaluating ST3, using it mostly for creating Markdown files for use on GitHub and my WordPress site. I’ve installed the MarkdownEditing package, and have tried several color_schemes that were included in that package. I’m not particularly keen on any of them mostly because the contrast is low for some of the text (e.g. URLs).

I read that Soda is a theme that works well with Retina displays, and might have better contrast. I installed it. I thought that applying it would be handled the same way as applying a color_scheme, and so I added the following line to my User file for Markdown.sublime-settings:

"theme": "Soda Light 3.sublime-theme", 

But this doesn’t seem to have any effect when I open one of my markdown (.md) files. I can change color schemes in my User file, and see the effect, but this Soda theme isn’t doing what I’d hoped.

My conclusion is that I’ve missed something :slight_smile: Can someone explain the relationship between Themes and Color Schemes, and if it’s possible to use MarkdownEditing with the Soda theme?

0 Likes

#2

The 10,000 foot overview is that a theme styles the visual aspects of Sublime (tabs, scrollbars, sidebar, etc) and a color scheme is used in file views to provide syntax highlighting and other visual coloring on the file content itself. As such they have little to do with each other except that authors of themes generally also include color schemes designed to complement their theme.

The color_scheme setting controls the colors used for files as you’re editing them. This includes a variety of colors such as the overall background color of the file (and by extension the background color of the tab that represents it), the color for regular text, selected text, and (perhaps most interestingly) the colors to use for various syntax elements amongst other things.

The color_scheme setting can be set globally, per project or per syntax, allowing you to have different syntax coloring in play for different types of files.

In contrast to that, the theme setting controls the visual display of Sublime outside of file views. This controls things like the sizes, shapes and colors of the tabs that represent files, the display of the sidebar, the icons used in the find panels, and the interface fonts for things that aren’t file content.

As it applies to the whole visual aspect of Sublime as a whole, the theme setting is a global setting and can’t be applied in a syntax specific way.

One potential vector of confusion here is that until recently color schemes had an extension of tmTheme even though they represent color schemes. The most recent releases include support for a new enhanced sublime-color-scheme format that is structured differently and has a less confusing name. tmTheme is still supported, however.

I don’t use the Soda theme, but it looks like it has some optional color schemes that you can download and install separately according to the page on package control.

From your post it sounds like your problem is mainly that you’ve installed the Soda theme and tried to apply it as a syntax specific setting for markdown files, which doesn’t work. You might want to try using that setting in your general preferences to see if you enjoy that as a theme over the Default or Adaptive themes that ship with Sublime.

Apart from that it sounds like you may be better served by looking for different color scheme packages you can install instead of different themes. As mentioned above, it’s not uncommon for a theme to also ship with color schemes meant to go well with it, and there’s no reason that you can’t use those color schemes without using the theme that they shipped with.

3 Likes

#3

Thank you - great answer that clears a lot of fog! I’m mostly concerned with the file view, as that’s where I’m struggling with the low contrast “grey-on-black” and "grey-on-yellow"schemes like the ones offered in the MarkdownEditing package. This raises a coupla’ other questions/clarifications if you don’t mind:

  1. Is there a color_scheme that’s generally regarded to work well on a Macbook Retina display?

  2. In general, can I always use color_schemes that are not part of a package (such as MarkdownEditing)?

0 Likes

#4

I can’t answer this one personally; I’ve just always used the default Monokai color scheme across all of my machines, and my MacBook doesn’t have a retina display. I would imagine that the font_face, font_size and font_options that you’re using would play into that more than the color scheme though (except for the colors used, I guess)?

There’s nothing that ties you to using any particular color_scheme for any particular file type, if that’s what you mean. Any Sublime package may or may not include a color scheme resource of some sort, and as long as that package is installed you can use that in the color_scheme setting anywhere that setting is allowed.

Sublime itself comes with a few color schemes out of the box, for example.

In particular, it would appear that MarkdownEditing goes out of it’s way to apply a color_scheme setting for you for markdown files which overrides what would otherwise be the default color scheme everywhere else. You could edit the markdown specific settings with something like "color_scheme": Monokai.sublime-color_scheme to use the default in Markdown files.

Something else to try would be to open a source file of some sort other than Markdown (for example an HTML file) and use the Preferences > Color Scheme... menu command to see if any of the default color schemes work better for you.

If you find one you like, copy the color_scheme setting from your user preferences to the markdown settings in order to use that one for markdown files.

Note also that your customizations to Sublime (settings, key bindings, etc) are a part of the package User, so aside of anything else you can also put color schemes or other resources in that package to use as well, which includes making your own.

Depending on the level of customization that you’re interested in, it’s also possible to override particular colors in any color scheme to alter them to your liking.

1 Like

#5

Pretty much all of them. The low contrast ones, or very bright ones such as Sixteen, usually work better on a good Retina screen than elsewhere. But low contrast color schemes are, let’s say, an acquired taste. Soda is pretty ancient, I wouldn’t recommend that. Anything you don’t like about the default set?

Color schemes apply colors to the scopes provided by syntax packages. There are guidelines that help syntax package developers set up sane scopes so that pretty much any color scheme will be able to highlight the code in a sensible way. Usually when I see color schemes packaged with syntax packages, it’s a red flag that the syntax developer wanted to do more than was available within the boundaries of the guidelines. Using a different color scheme than one that’s packaged may result in you missing out on some specific highlights.

In this case MarkdownEditing is a bit of a pre-3.0 remnant that tried to bring some Markdown features to ST when the default didn’t have any. The macros look nice though. Apart from aggressively setting things for you the syntax packages don’t look too bad and should work with a lot of color schemes. You don’t exactly need plugins to work with Markdown though. Especially if you’re new to the whole ecosystem, I wouldn’t recommend installing all the plugins with Markdown in their name the first day :wink:

3 Likes

#6

Thanks for the info on Soda. Nothing really that I don’t like about the default; my question was motivated by: a) ignorance of the relationship between “themes and schemes” (now corrected by @OdatNurd), and b) not having the ‘acquired taste’ for low contrast. I think it’s all just really me trying to acclimate myself to the incredible “degrees of freedom” in ST3.

Aye, you’re right, they’re not necessary, or even very helpful in most cases. I was hoping to find something a bit more useful than syntax highlighting. And still hopeful that might come to pass in ST3… something like Typora is what I’d like… the “back and forth” between the marked-up and the rendered is what wears me out. The BIG advantage I find in ST3 is that the text insertion cursor is highlighted - it doesn’t get “lost” in a long document.

Cheers!

0 Likes