Colors

Use color for communication over decoration. Use of color should be purposeful, accessible, and help focus attention to what matters most.

Colors for Communication

We strive to establish recognizable patterns to guide users through the UI. CommCare uses similar palettes on both the mobile and server side.

When combining colors, use light text on a dark or medium background and dark text on a light background. We make use of Bootstrap 5's $min-contrast-ratio setting at a value of 3 to automatically determine when to show dark or light text on a background when using the text-bg-<$color> class on an element.

As described in Accessibility, many people are affected by various types of color blindness. It is important to make sure that colors are never the source of critical information. Also, when colors are used to compare information (legend of a bar or line chart) it is important that the colors used can be differentiated by people with each type of color blindness, and when color separation is not easily possible, distinguishable patterns are used in their place.

Interaction and Attention

Note: The subtle shades provided are present so that hex values of "subtle" colors are easily accessible for design purposes. These lighter subtle colors are intended to be coupled with darker text on top and are used as default backgrounds for Molecules like Alerts.

Call to Action

$primary: #5D70D2
$primary-subtle: #DFE2H6

Referred to as 'CommCare Blue'. Use for buttons, checkmarks, radio buttons or actionable primary icons. Links are a slightly darkened shade of this color ($blue-600) to improve contrast.

Download / Upload

$info: #01A2A9
$info-subtle: #CCECEE

Used typically for buttons indicating a download or upload action. Corresponds with 'info' classes

Success

$success: #358623
$success-subtle: #D9ECD4

Use when an action has been completed successfully, primarily for messaging. Rarely used for interactive elements like buttons.

Attention

$warning: #EEAE00
$warning-subtle: #FCEFCC

Use for warning-level information, less severe than an error but still in need of attention.

Error, Negative Attention

$danger: #E13019
$danger-subtle: #FAD8D4

Use to highlight an error, something negative or a critical risk. Use as text, highlights, banners or destructive buttons.

Neutral Colors, Text and Backgrounds

Text

$dark: #343A40

Used for the main text color.

Neutral

$secondary: #6C757D

Use for neutral visual indicators, typically borders or backgrounds.

Background

$light: #F8F9FA

Used for backgrounds that are light but distinct from the default white background, such as cards.

Colors for Design

Sometimes there is a need for additional colors when designing a new component which don't fall into any of the communication categories above. The simple requirement is a color that meets our branding requirements. For this we have several theme colors accessible through SCSS variables that follow the Dimagi brand guidelines and Bootstrap 5 shading rules.

Important: These colors should not be applied to HQ without sign-off from senior developers and a design review. The colors appear here for reference of what options are available for use.

CommCare Blue aka Blue

The CommCare "cornflower blue" is what's applied to the $primary, and therefore $blue or $blue-500 shade. Below are approved gradations from light to dark based on this color.

$blue-100: #DFE2F6
$blue-200: #BEC6ED
$blue-300: #9EA9E4
$blue-400: #7D8DDB
$blue-500: #5D70D2
equivalent to $primary
$blue-600: #4A5AA8
$blue-700: #38437E
$blue-800: #252D54
$blue-900: #13162A

Gray

While $dark, $secondary, and $light are the preferred shades of gray for the theme, it is also possible to choose additional shades listed below.

$gray-100: #f8f9fa
equivalent to $light
$gray-200: #e9ecef
$gray-300: #dee2e6
$gray-400: #ced4da
$gray-500: #adb5bd
$gray-600: #6c757d
equivalent to $secondary
$gray-700: #495057
$gray-800: #343a40
equivalent to $dark
$gray-900: #212529

Dimagi Gradient

Dimagi's branding has a gradient of color going from $dimagi-indigo (aka $indigo) to $dimagi-mango (aka $orange). We sliced this gradient into 25% intervals due to a decent contrast ratio of colors between intervals. However, since $orange often has an emotional conection between danger and warning, we leave that out of the usable "design" colors, preferring to include shades from $indigo to $salmon.

$indigo: #3843D0
$purple: #694aaa
$pink: #9a5183
$salmon: #cb585d
$orange: #FC5F36

Gradient Shades

Below are the above four design-friendly gradient colors divided further into Bootstrap 5 interval shades, where the $*-500 color is equivalent to the main color listed above.

$indigo-100: #d7d9f6
$indigo-200: #afb4ec
$indigo-300: #888ee3
$indigo-400: #6069d9
$indigo-500: #3843D0
$indigo-600: #2d36a6
$indigo-700: #22287d
$indigo-800: #161b53
$indigo-900: #0b0d2a
$purple-100: #e1dbee
$purple-200: #c3b7dd
$purple-300: #a592cc
$purple-400: #876ebb
$purple-500: #694aaa
$purple-600: #543b88
$purple-700: #3f2c66
$purple-800: #2a1e44
$purple-900: #150f22
$pink-100: #ebdce6
$pink-200: #d7b9cd
$pink-300: #c297b5
$pink-400: #ae749c
$pink-500: #9a5183
$pink-600: #7b4169
$pink-700: #5c314f
$pink-800: #3e2034
$pink-900: #1f101a
$salmon-100: #f5dedf
$salmon-200: #eabcbe
$salmon-300: #e09b9e
$salmon-400: #d5797d
$salmon-500: #cb585d
$salmon-600: #a2464a
$salmon-700: #7a3538
$salmon-800: #512325
$salmon-900: #291213

Dimagi Palette

Below are the six colors named in the Dimagi color palette. The ones in use by our theme are marked. However, since $dimagi-deep-purple feels very similar to $indigo-800 and $dimagi-sky similar to $blue-400, we prefer to avoid use of those colors.

$dimagi-deep-purple: #16006D
$dimagi-indigo: #3843D0
equivalent to $indigo
$dimagi-sky: #8EA1FF
$dimagi-marigold: #FEAF31
equivalent to $yellow
$dimagi-mango: #FC5F36
equivalent to $orange
$dimagi-sunset: #E44434
equivalent to $red