I recently found StudioStyles, a collection of Visual Studio 2010 color schemes, and it inspired me to create my own. I've never bothered customizing my editor colors before, but since VS2010 has an overall darker look, I thought I'd have a bash at creating a matching dark editor scheme.
Looking through some of the submissions on the site, I was struck by how... well... random most of them are. Without meaning to be rude, they just look like someone went through the list, randomly assigning colors. Many many programmers believe coding and graphic design are polar opposites - that if you're a coder, you must necessarily suffer from "programmer art", and hence that it's pointless to ever try to learn better design skills. I completely disagree with this diagnosis.I'm going to use only one design rule for this color scheme - consistency: keep similar things similar, and make different things different.
Comments - GreenComments have always been green in Visual Studio, and I'm going to keep them that way - a vibrant green, made bold, to catch the eye. (If comments aren't important, then why are you writing them?) Comment hyperlinks and the text in #region blocks also match.
Literals - BlueString literals are red in the standard Visual Studio color scheme, but I wanted to reserve that color for errors and the like. In my mind strings are blue (don't ask me why) so I've chosen a light blue for strings.With consistency in mind, what else should match this?
- String literals are blue, so why not other literals, such as integers? The common color will highlight "magic values" in code.
- We'll need to colorize XML and HTML, so we can make attribute values blue too.
- I've also chosen to see CSS values as literals - they go blue too. (You could easily argue the toss about that though).
Keywords - GraySince the background is black, 'unadorned' text will be white - a nice easy choice. How about keywords?I want to make them a different color - so I can tell when I've typed 'retrun' for the billionth time - but I don't consider them to be "core" code. I think of them as scaffolding around my identifiers. (Perhaps I'm a LISPer at heart). I've chosen to keep them a neutral color, but a dimmer shade, so they fade out - hence gray.
Types - Yellow/OrangeColorizing types is handy as it again allows me to see when I've mis-typed something. I want them to stand out (so a dim color is out), and I don't want them confused with anything else - so reds, greens, and blues are gone. Yellows and light oranges seem a good choice - close enough to the normal white text, but sufficiently different to catch the eye. I've chosen a light orange for types, and highlighted interface types as yellow. (I figure that looking at how interfaces are defined and used is often a good way to understand the structure of a body of code - hence the slightly more eye-catching color).
(Oddly enough, this doesn't seem to work for types in C++ - they always seem to come out white. Not sure why.)
Errors, Warnings, and Oddities - RedThis was an easy color to choose - red (for me) means stop and think. There are a few code constructs that I wanted to highlight as either dangerous or needing attention:
- Compiler errors and warnings;
- Preprocessor directives;
Editor Overlays - Purple/Dark BlueVisual Studio now highlights parts of the source depending on where youyr cursor is - it highlights matching braces, and will also display all usages of the symbol at the caret. These display can change rapidly, so shouldn't be too distracting. I've chosen a dark purple, which is subtly visible, but which blends in with the black background.
We need a related color for the selection too, so I've chosen dark blue.
OmissionsThere's still quite a few entries in the colors list I haven't filled out - the main areas being:
- Test Coverage
Conclusion & DownloadSo there you go. Obviously color schemes are very personal (and contentious). I think I've done a pretty good job; you might well think otherwise. Even if you don't like this particular scheme, I hope you'll agree that setting a few design principles in place before assigning colors can help you choose (and use) the colors effectively.Sadly there's no way to upload my settings to StudioStyles, and I'm too lazy to re-do all the work by hand. Until they allow that option, I'll host the settings from here:
Download hackification.vssettingsSave this file somewhere, then use Tools -> Import and Export Settings... to merge them in.