Creating A New Theme

By Lex Li

This page shows you how to create a new theme.

In this article

Start A New Theme (2.11)

Once you know the basics of Visual Studio 2012/2013 themes, it is quite easy to start your own themes. Below we show an example of developing a custom Visual Studio 2012 theme based on the Light theme.

  1. Open Visual Studio 2012 and install Color Theme Manager extension.

  2. Create a new theme there and export as a .vstheme file.

  3. Open ThemeVS2012.csproj.

  4. Put the .vstheme file into ThemeVS2012\Resources folder and add it to Resources.resx.

  5. Copy ThemeVS2012\VS2012LightTheme.cs to ThemeVS2012\VS2012CustomTheme.

  6. Open VS2012CustomTheme.cs, and rename the class to VS2012CustomTheme.

  7. Change its constructor to use the .vstheme file from the resources.

  8. (Optional) Write your own element factory classes and bind them to Theme.Extender if you want to further customize rendering effect.

Note

If you don’t want to use Color Theme Manager, please analyze VS2012PaletteFactory source code to see from where each colors come.

Once the project can compile without an error, you get your own theme ready for testing.

Start A New Theme (2.12 and Above)

Once you know the basics of Visual Studio 2012/2013 themes, it is quite easy to start your own themes. Below we show an example of developing a custom Visual Studio 2012 theme based on the Light theme.

  1. Open Visual Studio 2012 and install Color Theme Manager extension.

  2. Create a new theme there and export as a .vstheme file.

  3. Use tools such as 7-Zip to compress the file using gzip archive format as .gz.

  4. Open ThemeVS2012.csproj.

  5. Put the .gz file into ThemeVS2012\Resources folder and add it to Resources.resx.

  6. Copy ThemeVS2012\VS2012LightTheme.cs to ThemeVS2012\VS2012CustomTheme.

  7. Open VS2012CustomTheme.cs, and rename the class to VS2012CustomTheme.

  8. Change its constructor to use the .gz file from the resources (ThemeBase.Decompress method decompresses the file at runtime).

  9. (Optional) Write your own element factory classes and bind them to Theme.Extender if you want to further customize rendering effect.

Note

If you don’t want to use Color Theme Manager, please analyze VS2012PaletteFactory source code to see from where each colors come.

Once the project can compile without an error, you get your own theme ready for testing.