Skip to content
Håvard Moås edited this page Mar 14, 2023 · 9 revisions

All the colors available are exported from our Design System and transformed for you to use from DIPS.Mobile.DesignTokens repository. The colors are available for you to use in both .NET Standard, Xamarin Android and Xamarin iOS projects.

By default, all the components from this component library will have the default color from our design system, but if you need to override them there should be a way for you to do that for each component.

.NET Standard

XAML

Colors are available in Colors.xaml by using Colors markup extension for your UI elements:

<Label BackgroundColor="{dui:Colors <designsystem-color-name>}" /> 

Code

If you need to access them by code, you can do the following:

Colors.GetColor(ColorName.<designsystem-color-name>)

Android

XML

To use the colors in a Android xml file:

<TextView
        android:background="@color/color_primary_light_primary_100"
        android:text="Hello World!" />

This will look broken for you in the IDE, but once the app is built it will work.

Code

To transform the color to a AColor you can use the following method:

Colors.GetColor((ColorName.<designsystem-color-name>).ToAndroid();

iOS

Code

To transform the color to a UIColor you can use the following method:

Colors.GetColor(ColorName.<designsystem-color-name>).ToUIColor();
Clone this wiki locally