Share via


How to: Provide Custom Color Classes

You can provide custom color classes by adding colors to the tokenInfoTable array and overriding the getColorInfo method.

This topic is based on the Visual Studio Language Package solution, which provides a basic implementation of the Babel package. For more information about creating one of these solutions, see Walkthrough: Creating a Language Service Package.

To provide custom color classes

  1. In the service.cpp file, in the g_languageProperties global constant, set the RequestStockColors property to zero to specify that you are going to use custom color classes.

  2. Define a custom color enumeration after the language information. The first member of the enumeration should have a value greater than the last default color class (ClassDefaultLast + 1) and should use the default color classes where appropriate.

  3. Apply the new colors to tokens in the tokenInfoTable array.

  4. Override the StdService::getColorInfo method to use the custom color enumeration instead of the default colors.

Although it is possible to specify any legal CSS style, the Babel package recognizes only a subset of properties and values. See the "Supported CSS Styles" section in the IBabelService::GetColorInfo Method.

Change History

Date

History

Reason

July 2008

Rewrote and refactored project.

Content bug fix.