Messaging UI - Themes, Colors and Customize Screen
This page describes the colors of the messaging UI, the light and dark themes, saved looks (customizations), and the Customize screen.
Colors
A color is a 32-bit value, 0xAARRGGBB. In JSON it is "#AARRGGBB" or "#RRGGBB".
Every color has a default for the light theme and one for the dark theme. setDefaults(dark) sets
them. A color is always the exact color shown; there is no “0 means default”.
The theme group has the colors shared by all screens:
| Setting | Light | Dark | Used for |
|---|---|---|---|
accentColor | #FF00A884 | #FF00A884 | buttons, switches, selected items |
toolbarColor, toolbarTextColor, toolbarIconColor | white, #FF111B21 | #FF1F2C34, #FFE9EDEF | the toolbar, its title and its icons |
backgroundColor | #FFFFFFFF | #FF111B21 | the background of the screens |
surfaceColor | #FFF0F2F5 | #FF202C33 | cards, sheets, the search field |
textPrimaryColor, textSecondaryColor | #FF111B21, #FF667781 | #FFE9EDEF, #FF8696A0 | text, and less important text |
dividerColor, borderColor | #FFE9EDEF, #FFD1D7DB | #FF222D34, #FF374248 | separators, outlines |
errorColor | #FFEA0038 | #FFF15C6D | errors and destructive actions |
selectionColor | #3300A884 | #4400A884 | selected rows and messages |
inputBackgroundColor | #FFFFFFFF | #FF2A3942 | the message input |
chipBackgroundColor, chipTextColor | #FFFFFFFF, #FF54656F | #FF182229, #FF8696A0 | dates in a chat |
quoteBackgroundColor | #14000000 | #26FFFFFF | a quoted message |
noticeBackgroundColor | #FFFFF5C4 | #FF182229 | notices in a chat |
metaColor | #FF667781 | #FF99AAB4 | the time in a message |
linkColor | #FF027EB5 | #FF53BDEB | links, phone numbers and emails |
onlineColor | #FF25D366 | #FF25D366 | the online dot |
patternColor, wallpaperDimColor | #12000000, transparent | #0DFFFFFF, #59000000 | the wallpaper pattern, and the dim over a wallpaper photo |
onAccentColor, onMediaColor | white | white | text and icons on the accent color, and over pictures |
mediaScrimColor, dimColor, shadowColor | #66000000, #59000000, black | the same | behind text over pictures, behind sheets, shadows |
toastBackgroundColor, toastTextColor | #E01A1A1A, white | the same | short messages |
letterAvatarTextColor, letterAvatarColors | white, a palette | the same | letter avatars |
Other groups have the colors of their own parts:
| Group | Colors |
|---|---|
messageAppearance | backgroundColor, myBubbleColor, peerBubbleColor, myTextColor, peerTextColor |
voiceMessages | waveColor, myPlayedColor, peerPlayedColor, recordingColor |
userList | backgroundColor, nameColor, messageColor, readIconColor, sensitiveIconColor, muteActionColor, archiveActionColor |
messageStatus | the icons by the time of a message, see Message status |
A color of a group comes from its own settings or from theme, never from another group.
The app sets colors in MesiboUI_onConfig, for both themes:
@Override
public void MesiboUI_onConfig(MesiboUiConfig config, boolean dark) {
config.theme.toolbarColor = 0xff00868b;
config.theme.toolbarTextColor = 0xffffffff;
config.theme.toolbarIconColor = 0xffffffff;
config.theme.accentColor = 0xff00868b;
if (!dark)
config.messageAppearance.myBubbleColor = 0xffd9fdd3;
}
override fun MesiboUI_onConfig(config: MesiboUiConfig, dark: Boolean) {
config.theme.toolbarColor = 0xff00868b.toInt()
config.theme.toolbarTextColor = 0xffffffff.toInt()
config.theme.toolbarIconColor = 0xffffffff.toInt()
config.theme.accentColor = 0xff00868b.toInt()
if (!dark)
config.messageAppearance.myBubbleColor = 0xffd9fdd3.toInt()
}
func MesiboUI_onConfig(config: MesiboUiConfig, dark: Bool) {
config.theme.toolbarColor = 0xff00868b
config.theme.toolbarTextColor = 0xffffffff
config.theme.toolbarIconColor = 0xffffffff
config.theme.accentColor = 0xff00868b
if !dark {
config.messageAppearance.myBubbleColor = 0xffd9fdd3
}
}
- (void)MesiboUI_onConfig:(MesiboUiConfig *)config dark:(BOOL)dark {
config.theme.toolbarColor = 0xff00868b;
config.theme.toolbarTextColor = 0xffffffff;
config.theme.toolbarIconColor = 0xffffffff;
config.theme.accentColor = 0xff00868b;
if (!dark)
config.messageAppearance.myBubbleColor = 0xffd9fdd3;
}
MesiboUiConfig config = await MesiboUI().getConfig();
config.theme.toolbarColor = 0xff00868b;
config.theme.accentColor = 0xff00868b;
await MesiboUI().setConfig(config);
The defaults of a theme
A new MesiboUiConfig has the defaults of the light theme. setDefaults(true) sets the dark
theme’s colors, setDefaults(false) the light theme’s.
To write a customization based on a theme’s defaults: set the defaults, change the settings, then write the configuration as JSON.
MesiboUiConfig config = new MesiboUiConfig();
config.setDefaults(true); // the dark theme's colors; false: the light theme's
config.theme.accentColor = 0xff7e57c2; // the changes
String json = config.toJson(false); // every setting, with its value
val config = MesiboUiConfig()
config.setDefaults(true) // the dark theme's colors; false: the light theme's
config.theme.accentColor = 0xff7e57c2.toInt() // the changes
val json = config.toJson(false) // every setting, with its value
let config = MesiboUiConfig()
config.setDefaults(true) // the dark theme's colors; false: the light theme's
config.theme.accentColor = 0xff7e57c2 // the changes
let json = config.toJson(false) // every setting, with its value
MesiboUiConfig *config = [MesiboUiConfig new];
[config setDefaults:YES]; // the dark theme's colors; NO: the light theme's
config.theme.accentColor = 0xff7e57c2; // the changes
NSString *json = [config toJson:NO]; // every setting, with its value
Text size
messageAppearance.textSize sets the size of the text of messages. The size also follows the text
size set in the system.
| Size | Android | iOS | JSON |
|---|---|---|---|
| Small | MesiboUI.TEXTSIZE_SMALL | MESIBO_TEXTSIZE_SMALL | "small" |
| Medium (default) | MesiboUI.TEXTSIZE_MEDIUM | MESIBO_TEXTSIZE_MEDIUM | "medium" |
| Large | MesiboUI.TEXTSIZE_LARGE | MESIBO_TEXTSIZE_LARGE | "large" |
| Extra large | MesiboUI.TEXTSIZE_EXTRALARGE | MESIBO_TEXTSIZE_EXTRALARGE | "extra_large" |
Wallpaper
The chat background is, in this order of priority:
messageAppearance.wallpaperPath: a picture file.messageAppearance.wallpaperImage: a picture set in code (Bitmapon Android,UIImageon iOS).messageAppearance.backgroundColor, with a faint pattern whenmessageAppearance.showWallpaperPatternis on.
wallpaperPath is a full path, or a file name in mesibo’s own folder:
- Android:
files/mesibouiin the app’s files. - iOS:
Application Support/MesiboUI. A file name stays valid when iOS moves the app’s folder on an update.
The Customize screen keeps the photos the user chooses in that folder. In the dark theme, a
wallpaper photo is dimmed with theme.wallpaperDimColor, so the bubbles stay readable.
Light and dark theme
By default, the messaging UI follows the system’s light or dark setting, also when it changes while
the app runs. setTheme selects a theme. It applies at once; the open screens are drawn again.
MesiboUI.setTheme(MesiboUI.THEME_SYSTEM); // or MesiboUI.THEME_LIGHT, MesiboUI.THEME_DARK
MesiboUI.setTheme(MesiboUI.THEME_SYSTEM) // or MesiboUI.THEME_LIGHT, MesiboUI.THEME_DARK
MesiboUI.setTheme(MESIBO_THEME_SYSTEM) // or MESIBO_THEME_LIGHT, MESIBO_THEME_DARK
[MesiboUI setTheme:MESIBO_THEME_SYSTEM]; // or MESIBO_THEME_LIGHT, MESIBO_THEME_DARK
MesiboUI().setTheme(MesiboUI.THEME_SYSTEM); // or MesiboUI.THEME_LIGHT, MesiboUI.THEME_DARK
Each time a theme is applied, mesibo makes a new configuration:
- It sets the theme’s defaults (
setDefaults). - It applies the customization saved for that theme, if any (see Customizations).
- It calls the app’s
MesiboUI_onConfig.
The open screens then use the new configuration. Settings made on an earlier configuration are
lost, so the app sets its settings in MesiboUI_onConfig, not once at start-up.
Customizations
A customization is a JSON of settings for the light theme or for the dark theme. It comes from the Customize screen, or from the app’s server. mesibo keeps one customization per theme, in mesibo’s key-value store, and applies it each time that theme is applied. mesibo must be set up before the customization functions are used.
| Function | Android | iOS | Flutter |
|---|---|---|---|
| Save the customization of a theme; an empty JSON deletes it. Saving does not apply it | MesiboUI.saveCustomization(json, dark) | [MesiboUI saveCustomization:json dark:dark] | MesiboUI().saveCustomization(json, dark) |
Get the saved customization; null (nil) if none | MesiboUI.getCustomization(dark) | [MesiboUI getCustomization:dark] | MesiboUI().getCustomization(dark) |
| Apply the current theme again, with its saved customization | MesiboUI.applyCustomization() | [MesiboUI applyCustomization] | MesiboUI().applyCustomization() |
applyCustomization does nothing when the current theme is applied and its customization has not
changed since.
To use a customization from the server at once:
MesiboUI.saveCustomization(json, false);
MesiboUI.applyCustomization();
MesiboUI.saveCustomization(json, false)
MesiboUI.applyCustomization()
MesiboUI.saveCustomization(json, dark: false)
MesiboUI.applyCustomization()
[MesiboUI saveCustomization:json dark:NO];
[MesiboUI applyCustomization];
await MesiboUI().saveCustomization(json, false);
await MesiboUI().applyCustomization();
Customize screen
launchCustomize opens the Customize screen. The user chooses the look of the messaging UI for the
current theme, light or dark. The screen has three tabs, each with a preview:
| Tab | Settings |
|---|---|
| Theme | ready-made palettes, the accent color, the toolbar colors |
| Chat list | the background, name and last message colors, letter avatars, the search mode, filters, archived chats, swipe actions, online indicator, profile popup |
| Chat | a wallpaper photo, bubble and text colors, the colors of the icons by the time, the text size, wallpaper pattern, bubble tail, large emoji, swipe to reply, covering the user’s own sensitive messages |
Changes are not applied while the user edits. The buttons:
- Back closes the screen. If something changed, it first asks: Discard the changes, or Cancel to stay.
- Apply calls the app’s callback with the customization as JSON: the changes, merged with the
customization saved before for that theme.
darktells which theme it is for. - Reset calls the callback with an empty JSON. The customization of that theme, and its wallpaper photo, are deleted.
The callback saves the customization to keep it. It returns true (YES) to apply it now, or
false (NO) to leave the screens unchanged. Without a callback, the changes are applied at once
but not saved.
MesiboUI.launchCustomize(context, (json, dark) -> {
MesiboUI.saveCustomization(json, dark); // empty after Reset: deleted
return true;
});
MesiboUI.launchCustomize(context) { json, dark ->
MesiboUI.saveCustomization(json, dark) // empty after Reset: deleted
true
}
MesiboUI.launchCustomize(self) { json, dark in
MesiboUI.saveCustomization(json, dark: dark) // empty after Reset: deleted
return true
}
[MesiboUI launchCustomize:self closed:^BOOL(NSString *json, BOOL dark) {
[MesiboUI saveCustomization:json dark:dark]; // empty after Reset: deleted
return YES;
}];
MesiboUI().launchCustomize((json, dark) {
MesiboUI().saveCustomization(json, dark); // empty after Reset: deleted
});
A wallpaper photo chosen by the user is already saved in mesibo’s folder. The JSON has its file
name in messageAppearance.wallpaperPath.
On Android, a tap on a color shows a grid of colors and a field for a color code. On iOS, it opens the system color picker.