Iris Classon
Iris Classon - In Love with Code

WinRT app guide: Step 8: Typography and color compliance, styling up the app and the RadControl chart

To read the other steps in the step by step guide for creating a Metr0/ WInRT application go here

Time to have a talk about design. As I’ve understood it, most devs aren’t too keen on this part- but for WinRT / Windows Store Apps this an important requirement. To make it easier for us I’ll spread the design info over several posts, a spoonful at the time. For the whole rundown download the guidelines ‘book’ here
On the menu today: Typography and colors

The guidelines state that:

  • Colors have to strengthen the brand of the app

  • Colors must comply with the AA contrast (accessibility) when used for text

  • Fonts should comply to the four level font hierarchy, with Segoe UI as a base

  • Font and color use should be consistent

Problem 1:

I have no idea how to pick colors
Solution suggestion:
Color sample an image, or if there is- an existing web site for the app
Start with a base color and let a tool such as Kuler.Adobe match colors for you
Have a look at predefined palettes from other users at Kuler.Adobe
Designer are pro’s when it comes to picking colors that work together, so using a fashion palette site to find colors is a good tip. Make sure you balance of the colors with base tones if they are tone-in-tone, and that you check the contrast for colors used on text.
Two fashion blogs sporting great palettes:
Wearpalettes
Color-collective¨

Fashion color palettes

My favorite color matcher/ sampler

Color sampling a screenshot of my blog using Kuler

Problem 2:
How do I know if the foreground color of the text and the background color are contrast compliant? (I don’t want to run the WACK tool to check each time)
Solution:
Use sites such as this one to check contrast compliance, AA is the recommended minimum.

Testing color contrast compliance online

To read more about : Meeting requirements for accessible text (Windows Store apps using C#/VB/C++ and XAML)

Problem 3:

How can I quickly implement the typography guidelines?
Solution:
Stick to the predefined styles that come with the templates, even if it seems like the font sizes are ‘of’
Define the foreground color in the themedictionary

For more of a read:
Font guidelines for Metro style apps /Windows Store apps/ WinRT Apps / Modern UI (this is sooo tedious!- make up your mind !)
11 pt. Segoe UI Semilight snapped view, links, body text, (semibold for item title/header)
9 pt. Segoe UI for short text elements,tertiary info
20 pt. Segoe UI Light for text elements that need to be clearly visible and draw user attention, but are short and fit on a single line, page subheader
42 pt. Segoe UI Light for prominent UI elements that consist of one or two words on a single line, page header
Read and write text: Calibri 13pt (same size as Segoe UI 11pt)

So I took the liberty to find us some new colors for the app, a base set, and a details set. This is how they look like:

Palettes, base

Palettes, details

And after setting the fonts to the ones predefined in the resourcedictionary and the colors using the palettes, this is how the app looks like:

The new look for the app

And to set the color of the bar series (the Telerik RadControl) you simply add this to the code:

Setting the color for the bar series on the Telerik RadControl for Windows 8 UI style

[sourcecode language=“XML”]
<Page
x:Class="Mihsp.MainPage"
IsTabStop="false"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Mihsp"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="using:Telerik.UI.Xaml.Controls" mc:Ignorable="d">

<Page.Resources>  
    <CollectionViewSource x:Name=&quot;activitiesCollection&quot; IsSourceGrouped=&quot;True&quot;></CollectionViewSource>  
</Page.Resources>  

<Grid Style=&quot;{StaticResource LayoutRootStyle}&quot; x:Name=&quot;LayoutRoot&quot;>  
    <Grid.Resources>  
    </Grid.Resources>  
    <Grid.RowDefinitions>  
        <RowDefinition Height=&quot;140&quot;/>  
        <RowDefinition Height=&quot;\*&quot;/>  
        <RowDefinition Height=&quot;100&quot;/>  
    </Grid.RowDefinitions>  
    <Grid.ColumnDefinitions>  
        <ColumnDefinition Width=&quot;120&quot;/>  
        <ColumnDefinition Width=&quot;\*&quot;/>  
        <ColumnDefinition Width=&quot;120&quot;/>  
    </Grid.ColumnDefinitions>  
    <TextBlock Grid.Column=&quot;1&quot; HorizontalAlignment=&quot;Left&quot; VerticalAlignment=&quot;Bottom&quot; Style=&quot;{StaticResource HeaderTextStyle}&quot; Foreground=&quot;#39ACE3&quot; Text=&quot;MIH!SP&quot;/>  
    <Grid Grid.Column=&quot;1&quot; Grid.Row=&quot;1&quot;>  
        <Grid.ColumnDefinitions>  
            <ColumnDefinition x:Name=&quot;column&quot; Width=&quot;2\*&quot;/>  
            <ColumnDefinition Width=&quot;\*&quot;/>  
            <ColumnDefinition Width=&quot;3\*&quot;/>  
        </Grid.ColumnDefinitions>  
        <ListView x:Name=&quot;itemListView&quot; Padding=&quot;0,10,0,0&quot; ItemsSource=&quot;{Binding Source={StaticResource activitiesCollection}}&quot; >  
            <ListView.GroupStyle>  
                <GroupStyle>  
                    <GroupStyle.HeaderTemplate>  
                        <DataTemplate>  
                            <Border Background=&quot;#A66C11&quot; Width=&quot;{Binding ElementName=column, Path=ActualWidth}&quot; HorizontalAlignment=&quot;Stretch&quot;>  
                                <TextBlock Text='{Binding Key}' Style=&quot;{StaticResource SubheaderTextStyle}&quot; Margin=&quot;5&quot;/>  
                            </Border>  
                        </DataTemplate>  
                    </GroupStyle.HeaderTemplate>  
                </GroupStyle>  
                </ListView.GroupStyle>  
                <ListView.ItemTemplate>  
                <DataTemplate>  
                    <Border Background=&quot;#004FC6&quot; Padding=&quot;20&quot; >  
                    <StackPanel Orientation=&quot;Vertical&quot; HorizontalAlignment=&quot;Stretch&quot;>  
                            <TextBlock Text=&quot;{Binding Title}&quot; Style=&quot;{StaticResource TitleTextStyle}&quot;/>  
                            <TextBlock Text=&quot;{Binding CategoryName}&quot; Style=&quot;{StaticResource ItemTextStyle}&quot;/>  
                            <TextBlock TextWrapping=&quot;Wrap&quot; Text=&quot;{Binding Comment}&quot; Style=&quot;{StaticResource BodyTextStyle}&quot;/>  
                    </StackPanel>  
                    </Border>  
                </DataTemplate>  
            </ListView.ItemTemplate>  
            <ListView.ItemContainerStyle>  
                <Style TargetType=&quot;ListViewItem&quot;>  
                    <Setter Property=&quot;HorizontalContentAlignment&quot; Value=&quot;Stretch&quot;></Setter>  
                    <Setter Property=&quot;Padding&quot; Value=&quot;0,5&quot;></Setter>  
                </Style>  
            </ListView.ItemContainerStyle>  
        </ListView>  
        <Button x:Name=&quot;Add&quot; Grid.Column=&quot;1&quot; Height=&quot;75&quot; HorizontalAlignment=&quot;Stretch&quot; VerticalAlignment=&quot;Top&quot; Background=&quot;#95A810&quot; Margin=&quot;20,0,20,0&quot; BorderBrush=&quot;{x:Null}&quot;>Add</Button>  
        <FlipView Grid.Column=&quot;2&quot;>  
            <FlipViewItem>  
                <Grid>  
                    <Grid.RowDefinitions>  
                        <RowDefinition Height=&quot;0.8\*&quot;/>  
                        <RowDefinition Height=&quot;0.2\*&quot;/>  
                    </Grid.RowDefinitions>  
                    <telerik:RadCartesianChart HorizontalAlignment=&quot;Stretch&quot; VerticalAlignment=&quot;Stretch&quot;>  
                        <telerik:RadCartesianChart.Grid>  
                            <telerik:CartesianChartGrid MajorLinesVisibility=&quot;Y&quot;/>  
                        </telerik:RadCartesianChart.Grid>  
                        <telerik:RadCartesianChart.VerticalAxis>  
                            <telerik:LinearAxis Minimum=&quot;1&quot; LabelStyle=&quot;{StaticResource CaptionTextStyle}&quot;/>  
                        </telerik:RadCartesianChart.VerticalAxis>  
                        <telerik:RadCartesianChart.HorizontalAxis>  
                            <telerik:CategoricalAxis LabelStyle=&quot;{StaticResource CaptionTextStyle}&quot;/>  
                        </telerik:RadCartesianChart.HorizontalAxis>  
                        <telerik:RadCartesianChart.Series>  
                            <telerik:BarSeries ItemsSource=&quot;{Binding AllEntries}&quot;>  
                                <telerik:BarSeries.PointTemplate>  
                                    <DataTemplate>  
                                        <Rectangle Fill=&quot;#B0127F&quot; />  
                                    </DataTemplate>  
                                </telerik:BarSeries.PointTemplate>  
                                <telerik:BarSeries.ValueBinding>  
                                    <telerik:PropertyNameDataPointBinding PropertyName=&quot;NrOfEntries&quot;/>  
                                </telerik:BarSeries.ValueBinding>  
                                <telerik:BarSeries.CategoryBinding>  
                                    <telerik:PropertyNameDataPointBinding PropertyName=&quot;Category&quot;/>  
                                </telerik:BarSeries.CategoryBinding>  
                            </telerik:BarSeries>  
                        </telerik:RadCartesianChart.Series>  
                    </telerik:RadCartesianChart>  
                    <Border VerticalAlignment=&quot;Center&quot; Grid.Row=&quot;1&quot;>  
                        <TextBlock Text=&quot;Something about the statistics shown&quot; Style=&quot;{StaticResource SubheaderTextStyle}&quot; Padding=&quot;15,20&quot;/>  
                    </Border>  
                </Grid>  
            </FlipViewItem>  
            <FlipViewItem>  
                <Grid>  
                    <Grid.RowDefinitions>  
                        <RowDefinition Height=&quot;0.8\*&quot;/>  
                        <RowDefinition Height=&quot;0.2\*&quot;/>  
                    </Grid.RowDefinitions>  
                    <Border Background=&quot;Orange&quot; VerticalAlignment=&quot;Bottom&quot; Grid.Row=&quot;1&quot;>  
                        <TextBlock Text=&quot;Second flipitem&quot; Style=&quot;{StaticResource BodyTextStyle}&quot; Padding=&quot;15,20&quot;/>  
                    </Border>  
                </Grid>  
            </FlipViewItem>  
        </FlipView>  
    </Grid>  
    </Grid>  
    <Page.BottomAppBar>  
        <AppBar x:Name=&quot;bottomAppBar&quot; Padding=&quot;10,0,10,0&quot;/>  
    </Page.BottomAppBar>  

Last modified on 2012-09-15

comments powered by Disqus