Surface Colors and Palettes
Microsoft Surface administrators control the default color scheme of the Surface system. This global color scheme determines the default colors of Surface controls that are rendered in all applications. Application developers can use those same colors to style additional elements in their applications. Alternatively, application developers can override the Surface colors to affect any element in an application that uses those colors.
Surface comes with the following four pre-defined color palettes. These palettes are defined in the classes of the Microsoft.Surface.Presentation.Palettes namespace. The color palettes and the Surface controls were designed to enable you to create a sophisticated, unembellished layout that emphasizes content. The colors in each palette complement each other stylistically, and the controls use a clean and simple design that encourages users to interact directly with content.
This is the default color scheme. This color scheme makes applications more visible in physical environments that are brightly lit.
This color scheme makes applications more visible in physical environments that are dimly lit.
This color scheme provides maximum visibility for users with low vision, in a brightly-lit environment.
This color scheme provides maximum visibility for users with low vision, in a dimly-lit environment.
|Windows Presentation Foundation (WPF) controls that are not Surface controls might not use the Surface color scheme.|
Administrators specify the default color scheme in the registry. (For more information, see the "Administrator Options" section that follows.)
When your application starts, the default color scheme determines the initial values of the color properties in the SurfaceColors run-time object by setting them to the values in the corresponding palette.
The color properties of the SurfaceColors run-time object determine the values of color resources that are available to all Surface applications.
The color resources are used in the default templates of Surface controls. Thus, the default color scheme determines the default colors of Surface controls in all applications.
If the Accessibility options of the operating system are set to a High Contrast theme, all Surface applications will use the "DarkHighContrast" color scheme.
To respect Accessibility standards, the "DarkHighContrast" color scheme is locked and cannot be overridden by the registry or by the application developer. Only if a desktop theme other than High Contrast is chosen will the Surface color scheme unlock, restoring the colors in your application.
A High Contrast theme is set in the Personalization section of Control Panel, or when the High Contrast shortcut (Alt+Left Shift+Print Screen) is pressed.
Administrators can specify the Surface color scheme by creating the following registry value:
|Registry key||String value name||Possible values|
|Setting this registry value will affect only devices made for Surface or Windows 7 computers that have the Surface SDK installed.|
Surface application developers have the following options when it comes to using or modifying colors in their applications:
- Use the default color scheme to style Surface controls.
To use the Surface color scheme to style Surface controls in your application, you don't have to do anything. The controls in your application are automatically skinned using the Surface colors.
- Consume Surface colors.
If you want to use Surface colors to style other elements in your application, you can set the colors and brushes in your application to the values of the SurfaceColors properties or to their corresponding resources.
For more information, see Styling Elements in your Application by using Surface Colors.
- Overwrite Surface Colors.
To overwrite the Surface colors applied to Surface controls and other elements in your application, you can overwrite the color resources in XAML in the scope of an object, a page, or the application.
For more information, see Overwrite SurfaceColor Resources.
- Change the Default Palette.
If you decide that your application looks best using a specific color scheme, you can set the default palette for your application to one of the four Surface palettes. This change will not affect other Surface applications.
For more information, see Setting the Default Palette.
Testing Your Colors
Test your application in all color schemes to make sure that no portion of your user interface (UI) disappears. For example, if you set the background color of your root layout panel to a dark brush while in the "Dark" theme, the text of an ungrouped SurfaceRadioButton will disappear if the theme changes to "Light" because the text in the SurfaceRadioButton automatically changes to a dark color.
ConceptsCustomizing Control Styles
© Microsoft Corporation. All rights reserved.