HatangChatTheme

data class HatangChatTheme(val isDark: Boolean, val palette: HatangPalette, val accent: Color, val onAccent: Color = Color(HatangContrast.onAccentFor(accent.toArgb())), val fontFamily: FontFamily? = null, val bubbleRadius: Dp = HatangRadius.lg, val mineBubble: Color? = null, val onMineBubble: Color? = null, val theirBubble: Color? = null, val onTheirBubble: Color? = null)

Colours and shapes of the chat UI. By default the SDK derives one from the site's brand colour (fromSite); hosts may pass their own to HatangConfig(theme = …, darkTheme = …).

Constructors

Link copied to clipboard
constructor(isDark: Boolean, palette: HatangPalette, accent: Color, onAccent: Color = Color(HatangContrast.onAccentFor(accent.toArgb())), fontFamily: FontFamily? = null, bubbleRadius: Dp = HatangRadius.lg, mineBubble: Color? = null, onMineBubble: Color? = null, theirBubble: Color? = null, onTheirBubble: Color? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Accent (site colour): send button, own bubbles, links.

Link copied to clipboard

The accent as a text colour on the chat's backgrounds (quick replies, outlined buttons, links, prices): the site colour itself when it reads at WCAG AA (4.5:1) on the page, card and bubble backgrounds, otherwise the nearest darker (light) or lighter (dark) shade that does.

Link copied to clipboard

Bubble corner radius.

Link copied to clipboard
val fontFamily: FontFamily? = null

Font family for every text (null: the system font).

Link copied to clipboard

Dark theme.

Link copied to clipboard
val mine: Color

Resolved own bubble background.

Link copied to clipboard
val mineBubble: Color? = null

Own bubble background (default: accent).

Link copied to clipboard

Text on accent, chosen by contrast.

Link copied to clipboard

Resolved own bubble text.

Link copied to clipboard
val onMineBubble: Color? = null

Own bubble text (default: onAccent).

Link copied to clipboard
val onTheirBubble: Color? = null

Their bubble text (default: fg).

Link copied to clipboard

Resolved their bubble text.

Link copied to clipboard

Base colours.

Link copied to clipboard
val theirBubble: Color? = null

Their bubble background (default: the raised surface).

Link copied to clipboard

Resolved their bubble background.