As you may know, I’m currently working on Mishra Reader which is intended to be a cool Google Reader for Windows.
I develop it using WPF with design and usability in mind.
I’m not a designer (at all) but following some guidance I achieved to provide a visually appealing application. So I will try to expose here some tricks to help developers producing more beautiful applications
Note: The screens here are from the beta 1 which will be available this Friday .
First of all, we have to keep the coherence of the application by selecting a few numbers of colors.
For Mishra Reader, I selected 4 colors:
- Background color: this color is used to paint the background of controls
- Foreground color: this color is used to draw text and border of unfocused controls
- Darker foreground color: I use this color when I want to display some texts alongside a more descriptive version. The foreground color is for the main text and the darker one is for the description
- Accent color : Like in Windows Phone, I have a special color to attract user attention
So with only 4 colors (and no more, we don’t want to draw a rainbow), we can produce something like that:
You have to be focused on keeping this coherence with colors and select the good one at the right place. For example, in the options screen, I designed a checkbox and use the accent color in it. Of course, the accent color must be displayed only when the checkbox is checked:
We can also note that help message use the darker foreground color to distinguish with the option text.
Finally, as I wanted to allow user to change the accent color, I cannot leave the application logo unchanged. So I developed a small bunch of code to apply the accent color to a grayscale logo:
The code used is the following:
- public static WriteableBitmap GetColoredLogo(OptionsManager optionsManager)
- WriteableBitmap bmp = new WriteableBitmap(new BitmapImage(new Uri("pack://application:,,,/Assets/MishraReader.png")));
- int size = bmp.PixelHeight * bmp.PixelWidth * bmp.Format.BitsPerPixel / 8;
- byte pixels = new byte[size];
- Color accentColor = (Color) ColorConverter.ConvertFromString(optionsManager.AccentColorCode);
- bmp.CopyPixels(pixels, bmp.PixelWidth * bmp.Format.BitsPerPixel / 8, 0);
- for (int index = 0; index < size; index += 4)
- byte b = pixels[index];
- byte g = pixels[index + 1];
- byte r = pixels[index + 2];
- if (r > 250 && g > 250 && b > 250)
- pixels[index + 2] = (byte)Range(0, 255, accentColor.R * Range(0, 1, r / 255.0f + 0.4f));
- pixels[index + 1] = (byte)Range(0, 255, accentColor.G * Range(0, 1, b / 255.0f + 0.4f));
- pixels[index] = (byte)Range(0, 255, accentColor.B * Range(0, 1, b / 255.0f + 0.4f));
- bmp.WritePixels(new Int32Rect(0, 0, bmp.PixelWidth, bmp.PixelHeight), pixels, bmp.PixelWidth * bmp.Format.BitsPerPixel / 8, 0);
- return bmp;
Application in motion
The second point to take into account is the animations. You should never change something on your UI without an animation. And therefore you should never do something that can stuck the rendering and the animations.
In Mishra, I took a lot of time checking that my code is running in a background thread without interfering too much with the main thread. To do so, I always use the Dispatcher with a really low priority in order to not disturb animations:
- Dispatcher.BeginInvoke(DispatcherPriority.ContextIdle, new Action(() =>
I also spent a lot of time writing animations for each state that I had to change.
About animations, it is better to use some easing functions in order to have non linear transitions. Easing functions such as BackEase or CircleEase give an impression of performance. For example here is the code for displaying a control:
- <Storyboard x:Key="showSubscription">
- <DoubleAnimation Duration="0:0:0.300" To="1" Storyboard.TargetName="addSubscription" Storyboard.TargetProperty="Opacity"/>
- <DoubleAnimation Duration="0:0:0.300" To="0" Storyboard.TargetName="addSubscription" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)">
- <BackEase Amplitude="0.6" EasingMode="EaseOut"/>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="addSubscription" Storyboard.TargetProperty="Visibility">
- <DiscreteObjectKeyFrame KeyTime="0">
As you can see, I animated the opacity with a linear DoubleAnimation but the TranslateTransform.Y is animated by a beautiful BackEase function.
With the entire user interface moving smoothly with non-linear animations, the application is seen as efficient even if you are performing a lot of computations in the background.
Help your users: give them only what they need
Finally the last trick I want to share is about simplicity. Simple is beautiful! So do not produce overloaded interface with a lot of buttons on it.
You should instead present a clean user interface and make appear controls when they are required. For example, here we can see new icons appear only when the mouse is over an item:
Of course there is a lot of others points to take in account when you want to produce a good user interface. But as a developer, following these simple tricks is a good start