Colors
The mobile apps design system coloring logic is built using System Colors and Design Tokens
- Design Tokens
- System Colors
- Accessibility
- Dev
Design Tokens
Design Tokens are contextual colors based on the system colors.
The design token name structure is "$[property]-[semantic]-[weight]". (e.g $backgroundPrimaryHeavy, $textSuccessLight)
-
Property - The property we use this token for. The properties are:
backgroundtexticonoutline
-
Semantic - the meaning of the color, what is the message that we want to pass using this color. The semantics are:
neutralprimary- the primary color of the app, means, blue for Spaces app and green for Fit app.generalsuccesswarningdangerpremiumdinefitdisabledinverteddefault
-
Weight - the weight of the color (optional). The weights are:
lightmediumheavy
So, for example, a valid token can be: $backgroundPrimaryHeavy or $textSuccess.
System Colors
The System Colors are all the colors we use in our design system. (red30, grey10 and so on).
Utils
Colors.rgba(color, alpha)- Get the rgba value of a given color (e.g.Colors.rgba(Colors.red50, 0.4))Colors.getColorTint(color, tintKey)- Get a specific tint of a given color (e.g.Colors.getColorTint(Colors.red30, 70)will returnColors.red70)
Colors Linter
To avoid hard coded values and also to provide you with a quick way to use uilib colors without having to check what's the name of each hex value.
Use the auto-fix comes with this linter to get the uilib names automatically.