April 06, 2009 Posted in musings  |  .net

Another Visual Studio Color Theme

An interesting trend has emerged in the .NET community during the past couple of years, which involves developers sharing their favorite color theme for the Visual Studio code editor with their peers. VSSettingsDialog

It seems the origin of this trend is somehow related to the introduction of a new feature in Visual Studio 2005 that makes it really easy to export/import all or a subset of the customizations made to the IDE’s into a single XML file. These settings files (.vssettings) include  every configurable aspect of Visual Studio, from font colors and window sizes to keyboard shortcuts. Useful for backups as well as for keeping Visual Studio the way you like it every time you switch to work on a different computer.

What developers are most excited about, however, is exchanging the color combinations they use for the text editor included in the IDE, referred to as “themes”.

It’s interesting to notice how a fair amount of developers seem to prefer light text on a dark background, as opposed to the traditional “black on white” paper metaphor VimEmacsEffect introduced by the word processors. These themes mimic the colors used by the classic programmer text editors of the past, like VIM and EMACS running on DOS or UNIX, which used to sport dark gray or bright blue backgrounds.

Colors are entirely a matter of personal taste, and in this regard I prefer the clean contrast of  white text on black background. Some people even argue that dark backgrounds are easier on the eyes than white ones, due to the reduced amount of bright light emitted by the computer screens. However I don’t know of any official study conducted to scientifically prove this statement.

Being a developer myself, I also tweaked my own color theme for the text editor I use to write code on a daily basis, which in my case is Microsoft Visual Studio 2008. I took inspiration from other themes I’ve seen around on the Internet and adjusted them to my taste. In the end, I settled for the following:

  • Font: Consolas (the best-looking monospaced font when using ClearType)
  • Font size: 11 pt
  • Background: Black (#000000)
  • Text: White (#FFFFFF)
  • Keywords: Light Blue (#4B96FF)
  • Classes: Orange (#E4732B)
  • Interfaces: Yellow (#E5CA32)
  • Value types/Enumerations: Pink (#CA95FF)
  • Numbers: Green (#559762)
  • Strings: Red (#E83123)
  • Comments: Dark Grey (#696969)

It’s a high contrast scheme, but I feel comfortable with it since the colors are not as sharp as other similar ones like John Lam’s Vibrant Ink.

Here is how a C# file looks like with it:

VSSettingsCSEditor

And here is how an XML file looks like:

VSSettingsXMLEditor

You can download my Visual Studio color theme here. I have used it for quite a while now and I am pretty satisfied with it. However, I fell I’ll probably tweak it some more in the future. After all, there is always room for improvements.

Update 2010-04-20

I’ve modified my dark theme to work in Visual Studio 2010. Most of the settings worked straight way, so I only needed to make some minor changes like adding support for T-SQL keywords. By the way, the custom colours for user types and interfaces now finally work in Visual Basic too. You can download the Visual Studio 2010 theme from the link below.

Enrico Campidoglio

Hi, I'm Enrico Campidoglio. I'm a freelance programmer, trainer and mentor focusing on helping teams develop software better. I write this blog because I love sharing stories about the things I know. You can read more about me here, if you like.