Developer Docs - Mobile Docs - Colors

Understand color theory in Rock Mobile and learn how to leverage built in colors to build truly responsive and beautiful applications.

Theming is a very important aspect of a mobile application. Nowadays, dark mode responsiveness is built-in to nearly every application. Rock Mobile was able to simplify this process whilst making the design and development of mobile applications much easier.

Interface Colors

These are the bread and butter of your application. Every single built-in text component has one of these classes applied.

Interface colors

The colors you set here are respected in light mode. On dark mode, the colors swap in strength, allowing for a seamless transition of light and dark. For example, take the default interface colors:

Interface Colors

This is the light mode representation of the colors. In dark mode, the values will swap:

Interface Colors Dark Mode

To better describe the transition, when transitioning from light to dark mode:

Keep in mind, this is all dynamic! Meaning this is all extremely easy to utilize. All you need to do is assign an interface color to an object through CSS, and it will automatically become dark mode responsive.

These are useful colors to use around your application.

The Strong and Soft values simply switch when transitioning from light to dark mode (and vice versa).

Usage

Supported Colors

The following colors are available to you out of the box.

The most primary method to utilize application colors are through CSS utility classes. The pattern for these classes is as follows:

For example:

//- A frame with the "softest" background and a "soft" border.

    
    //- A label with the "stronger" text color.
    

Using this method for applying colors causes the colors to not automatically respond to light/dark mode changes.

You can access these color variables in your application styles by using the ?color-{value} syntax.

For example:

.my-card {
  padding: 16;
  background-color: ?color-interface-softest;
}

.my-header-label {
  text-color: ?color-interface-stronger;
}

Using this method for applying colors causes the colors to not automatically respond to light/dark mode changes.

Palette colors can be used with XAML properties of type Color using the following syntax.

Interface colors don't need the "App-" prefix.