Skip to main content

ColorScheme

The full set of semantic colours consumed by all Catalyst components.

Retrieve it via context.colorScheme. Two factory constructors are provided for convenience — ColorScheme.light() and ColorScheme.dark() — but every field may also be overridden individually using the default (required) constructor or copyWith.

Fields

FieldTypeDescription.light().dark()
canvasColorThe outermost page/screen background.0xFFFFFFFF0xFF0B0F19
surfaceColorStandard card and panel background.0xFFFFFFFF0xFF141924
subtleColorOne step above canvas; used for nested or secondary sections.0xFFF8F9FA0xFF1A2030
mutedColorMuted background for disabled or low-emphasis areas.0xFFF1F3F50xFF1E2638
tintColorLightly tinted background for brand-adjacent surfaces.0xFFF0F5FF0xFF141E3A
brandColorThe primary brand colour. Used for CTAs, active states, and focus rings.0xFF0066FF0xFF3B82F6
brandSoftColorA soft tint of brand for backgrounds behind brand-coloured elements.0xFFE5EEFF0xFF0F1E40
inverseColorHigh-contrast background — typically the inverse of canvas.0xFF0F172A0xFFF8FAFC
borderColorDefault border/divider colour.0xFFE2E8F00xFF273045
borderStrongColorA more prominent border for emphasis.0xFF94A3B80xFF3B4D6A
borderSubtleColorA very subtle border for low-emphasis separators.0xFFF1F5F90xFF1E2638
textColorDefault body text colour.0xFF0F172A0xFFF1F5F9
textMutedColorSupporting / secondary text colour.0xFF4755690xFF94A3B8
textSubtleColorPlaceholder and tertiary text colour.0xFF94A3B80xFF64748B
textDisabledColorText colour for disabled controls.0xFFCBD5E10xFF334155
successColorGreen — healthy, confirmed, or successful states.0xFF16A34A0xFF4ADE80
warningColorAmber — cautionary or pending states.0xFFD977060xFFFBBF24
dangerColorRed — error, destructive, or critical states.0xFFDC26260xFFF87171
infoColorBlue — informational states (defaults to brand).0xFF0066FF0xFF60A5FA
successSoftColorSoft green background for success banners/badges.0xFFDCFCE7rgba(74, 222, 128, 0.12)
warningSoftColorSoft amber background for warning banners/badges.0xFFFEF3C7rgba(251, 191, 36, 0.12)
dangerSoftColorSoft red background for danger banners/badges.0xFFFEE2E2rgba(248, 113, 113, 0.12)
infoSoftColorSoft blue background for info banners/badges.0xFFEFF6FFrgba(96, 165, 250, 0.12)

All fields are required on the default constructor — no colour is silently defaulted when constructing a ColorScheme from scratch.

Computed on-colours

ColorScheme also exposes read-only on* getters that compute a legible text colour for each background, using the WCAG luminance helper getTextColorFor from color_utils.dart:

GetterTypeComputed from
onCanvasColorcanvas
onSurfaceColorsurface
onSubtleColorsubtle
onMutedColormuted
onTintColortint
onBrandColorbrand
onBrandSoftColorbrandSoft
onInverseColorinverse
onSuccessColorsuccess
onDangerColordanger
onWarningColorwarning

These are computed, not stored — there is no onWarningSoft, onDangerSoft, onInfoSoft, or onInfo getter in the current API.

Overriding

Start from ColorScheme.light() or ColorScheme.dark() and call copyWith to change only the fields you care about:

ThemeData.light(
iconography: appIconography,
colorScheme: const ColorScheme.light().copyWith(
brand: Color(0xFF7C3AED),
brandSoft: Color(0xFFEDE9FE),
),
);

copyWith accepts every field shown above (all optional, all Color?) and falls back to the current value for anything left null.