Flutter Material 3 color scheme generator

Enter a seed colour and get a Material 3 ColorScheme built with the HCT tonal-palette algorithm: ColorScheme.fromSeed, the explicit ColorScheme with every role, Compose colours and CSS custom properties. The contrast of each on-colour is shown beside it.

Updated

HEX, 3 or 6 digits. This is Flutter's seedColor: the hue comes from it, the chroma is set by the variant.

tonalSpot is what ColorScheme.fromSeed uses unless you pass dynamicSchemeVariant.

Each palette then takes that colour's own hue and chroma instead of being derived from the main seed.

Seed colour in HCT

H 299.0 C 47.9 T 40.1

#6750A4, tonalSpot (Flutter default), 49 roles per brightness

light primary #65558F
light onPrimary #FFFFFF
light primaryContainer #E9DDFF
light onPrimaryContainer #4D3D75
light secondary #625B71
light secondaryContainer #E8DEF8
light tertiary #7E5260
light tertiaryContainer #FFD9E3
light error #BA1A1A
light surface #FDF7FF
light onSurface #1D1B20
light surfaceContainerHigh #ECE6EE
light outline #7A757F
dark primary #CFBDFE
dark onPrimary #36275D
dark primaryContainer #4D3D75
dark onPrimaryContainer #E9DDFF
dark secondary #CBC2DB
dark secondaryContainer #4A4458
dark tertiary #EFB8C8
dark tertiaryContainer #633B48
dark error #FFB4AB
dark surface #141218
dark onSurface #E6E0E9
dark surfaceContainerHigh #2B292F
dark outline #948F99

Flutter ColorScheme

// 1) One line. Flutter generates the roles for you:
final lightScheme = ColorScheme.fromSeed(
  seedColor: const Color(0xFF6750A4),
  brightness: Brightness.light,
);
final darkScheme = ColorScheme.fromSeed(
  seedColor: const Color(0xFF6750A4),
  brightness: Brightness.dark,
);

// 2) The same roles written out, so they never shift when Flutter updates its algorithm:
const lightColorScheme = ColorScheme(
  brightness: Brightness.light,
  primary: Color(0xFF65558F),
  onPrimary: Color(0xFFFFFFFF),
  primaryContainer: Color(0xFFE9DDFF),
  onPrimaryContainer: Color(0xFF4D3D75),
  primaryFixed: Color(0xFFE9DDFF),
  primaryFixedDim: Color(0xFFCFBDFE),
  onPrimaryFixed: Color(0xFF201047),
  onPrimaryFixedVariant: Color(0xFF4D3D75),
  secondary: Color(0xFF625B71),
  onSecondary: Color(0xFFFFFFFF),
  secondaryContainer: Color(0xFFE8DEF8),
  onSecondaryContainer: Color(0xFF4A4458),
  secondaryFixed: Color(0xFFE8DEF8),
  secondaryFixedDim: Color(0xFFCBC2DB),
  onSecondaryFixed: Color(0xFF1E192B),
  onSecondaryFixedVariant: Color(0xFF4A4458),
  tertiary: Color(0xFF7E5260),
  onTertiary: Color(0xFFFFFFFF),
  tertiaryContainer: Color(0xFFFFD9E3),
  onTertiaryContainer: Color(0xFF633B48),
  tertiaryFixed: Color(0xFFFFD9E3),
  tertiaryFixedDim: Color(0xFFEFB8C8),
  onTertiaryFixed: Color(0xFF31101D),
  onTertiaryFixedVariant: Color(0xFF633B48),
  error: Color(0xFFBA1A1A),
  onError: Color(0xFFFFFFFF),
  errorContainer: Color(0xFFFFDAD6),
  onErrorContainer: Color(0xFF93000A),
  surface: Color(0xFFFDF7FF),
  onSurface: Color(0xFF1D1B20),
  surfaceDim: Color(0xFFDED8E0),
  surfaceBright: Color(0xFFFDF7FF),
  surfaceContainerLowest: Color(0xFFFFFFFF),
  surfaceContainerLow: Color(0xFFF8F2FA),
  surfaceContainer: Color(0xFFF2ECF4),
  surfaceContainerHigh: Color(0xFFECE6EE),
  surfaceContainerHighest: Color(0xFFE6E0E9),
  onSurfaceVariant: Color(0xFF49454E),
  outline: Color(0xFF7A757F),
  outlineVariant: Color(0xFFCAC4CF),
  shadow: Color(0xFF000000),
  scrim: Color(0xFF000000),
  inverseSurface: Color(0xFF322F35),
  onInverseSurface: Color(0xFFF5EFF7),
  inversePrimary: Color(0xFFCFBDFE),
  surfaceTint: Color(0xFF65558F),
);

const darkColorScheme = ColorScheme(
  brightness: Brightness.dark,
  primary: Color(0xFFCFBDFE),
  onPrimary: Color(0xFF36275D),
  primaryContainer: Color(0xFF4D3D75),
  onPrimaryContainer: Color(0xFFE9DDFF),
  primaryFixed: Color(0xFFE9DDFF),
  primaryFixedDim: Color(0xFFCFBDFE),
  onPrimaryFixed: Color(0xFF201047),
  onPrimaryFixedVariant: Color(0xFF4D3D75),
  secondary: Color(0xFFCBC2DB),
  onSecondary: Color(0xFF332D41),
  secondaryContainer: Color(0xFF4A4458),
  onSecondaryContainer: Color(0xFFE8DEF8),
  secondaryFixed: Color(0xFFE8DEF8),
  secondaryFixedDim: Color(0xFFCBC2DB),
  onSecondaryFixed: Color(0xFF1E192B),
  onSecondaryFixedVariant: Color(0xFF4A4458),
  tertiary: Color(0xFFEFB8C8),
  onTertiary: Color(0xFF4A2532),
  tertiaryContainer: Color(0xFF633B48),
  onTertiaryContainer: Color(0xFFFFD9E3),
  tertiaryFixed: Color(0xFFFFD9E3),
  tertiaryFixedDim: Color(0xFFEFB8C8),
  onTertiaryFixed: Color(0xFF31101D),
  onTertiaryFixedVariant: Color(0xFF633B48),
  error: Color(0xFFFFB4AB),
  onError: Color(0xFF690005),
  errorContainer: Color(0xFF93000A),
  onErrorContainer: Color(0xFFFFDAD6),
  surface: Color(0xFF141218),
  onSurface: Color(0xFFE6E0E9),
  surfaceDim: Color(0xFF141218),
  surfaceBright: Color(0xFF3B383E),
  surfaceContainerLowest: Color(0xFF0F0D13),
  surfaceContainerLow: Color(0xFF1D1B20),
  surfaceContainer: Color(0xFF211F24),
  surfaceContainerHigh: Color(0xFF2B292F),
  surfaceContainerHighest: Color(0xFF36343A),
  onSurfaceVariant: Color(0xFFCAC4CF),
  outline: Color(0xFF948F99),
  outlineVariant: Color(0xFF49454E),
  shadow: Color(0xFF000000),
  scrim: Color(0xFF000000),
  inverseSurface: Color(0xFFE6E0E9),
  onInverseSurface: Color(0xFF322F35),
  inversePrimary: Color(0xFF65558F),
  surfaceTint: Color(0xFFCFBDFE),
);
Contrast of each on-colour against its background (WCAG 2.2 ratio)
PairBrightnessColoursRatioMeets
onPrimary on primarylight#FFFFFF on #65558F6.46:1AA text
onPrimaryContainer on primaryContainerlight#4D3D75 on #E9DDFF7.25:1AAA text
onSecondary on secondarylight#FFFFFF on #625B716.45:1AA text
onSecondaryContainer on secondaryContainerlight#4A4458 on #E8DEF87.18:1AAA text
onTertiary on tertiarylight#FFFFFF on #7E52606.43:1AA text
onTertiaryContainer on tertiaryContainerlight#633B48 on #FFD9E37.23:1AAA text
onError on errorlight#FFFFFF on #BA1A1A6.46:1AA text
onErrorContainer on errorContainerlight#93000A on #FFDAD67.23:1AAA text
onSurface on surfacelight#1D1B20 on #FDF7FF16.20:1AAA text
onSurfaceVariant on surfacelight#49454E on #FDF7FF8.87:1AAA text
onInverseSurface on inverseSurfacelight#F5EFF7 on #322F3511.65:1AAA text
outline on surfacelight#7A757F on #FDF7FF4.25:13:1 (large text, icons, borders)
outlineVariant on surfacelight#CAC4CF on #FDF7FF1.61:1below 3:1
onPrimary on primarydark#36275D on #CFBDFE7.70:1AAA text
onPrimaryContainer on primaryContainerdark#E9DDFF on #4D3D757.25:1AAA text
onSecondary on secondarydark#332D41 on #CBC2DB7.71:1AAA text
onSecondaryContainer on secondaryContainerdark#E8DEF8 on #4A44587.18:1AAA text
onTertiary on tertiarydark#4A2532 on #EFB8C87.71:1AAA text
onTertiaryContainer on tertiaryContainerdark#FFD9E3 on #633B487.23:1AAA text
onError on errordark#690005 on #FFB4AB7.71:1AAA text
onErrorContainer on errorContainerdark#FFDAD6 on #93000A7.23:1AAA text
onSurface on surfacedark#E6E0E9 on #14121814.34:1AAA text
onSurfaceVariant on surfacedark#CAC4CF on #14121810.89:1AAA text
onInverseSurface on inverseSurfacedark#322F35 on #E6E0E910.16:1AAA text
outline on surfacedark#948F99 on #1412185.88:1AA text
outlineVariant on surfacedark#49454E on #1412181.98:1below 3:1
  • Generated with the algorithm of material-color-utilities (2021 colour spec, contrast level 0, the family Flutter's fromSeed follows). Flutter pins its own copy of that library, so an older Flutter can differ in a few roles (the light on-container tones changed from 10 to 30).

How does a seed colour become a Material 3 ColorScheme?

Material 3 does not shade your colour lighter and darker in RGB. It converts the seed to HCT, a space built from CAM16 hue and chroma plus the L* lightness (tone) of CIELAB. Hue is the colour family, chroma is how colourful it is, and tone runs from 0 (black) to 100 (white). Because tone is perceptual, two colours with the same tone and different hues look equally light, which is what makes text on a coloured background predictable.

From the seed's hue the generator builds five tonal palettes. In the default tonalSpot variant: primary at chroma 36 on the seed's hue, secondary at chroma 16, tertiary at chroma 24 with the hue turned 60 degrees, neutral at chroma 6 and neutral variant at chroma 8. A fixed error palette sits at hue 25, chroma 84. Each palette is asked for a colour at a given tone, and where that hue cannot reach the requested chroma at that tone, the solver returns the most colourful in-gamut sRGB colour it can.

Roles are then fixed tones from those palettes. In the light scheme primary is tone 40 and onPrimary tone 100, primaryContainer is 90 and onPrimaryContainer 30; in the dark scheme they are 80, 20, 30 and 90. Surfaces come from the neutral palette: surface 98 (light) or 6 (dark), and the five surface container roles step from 100 to 90 in light and 4 to 22 in dark. Because the tones are fixed, a colour keeps the same contrast with its on-colour whatever the seed.

The seed itself usually does not appear in the scheme. A strong red seed gives a muted, pastel-leaning primary, since tonalSpot caps chroma. That is intended; use the vibrant variant for a primary that stays close to the seed's saturation.

seed -> HCT (hue, chroma, tone)
palette(variant, hue) -> TonalPalette(hue, chroma)
role = palette.tone(t)   light primary t=40, onPrimary 100, container 90, onContainer 30
                         dark  primary t=80, onPrimary 20,  container 30, onContainer 90

Which tone does each Material 3 role use?

Tone (0 black to 100 white) per role at the default contrast level, from the 2021 colour spec in material-color-utilities
RolePaletteLight toneDark tone
primary / secondary / tertiaryits own4080
onPrimary (and on-secondary, on-tertiary)its own10020
primaryContainerprimary9030
onPrimaryContainer (and the secondary, tertiary and error versions)its own3090
primaryFixed / primaryFixedDimprimary90 / 8090 / 80 (same in dark)
error / onError / errorContainererror40 / 100 / 9080 / 20 / 30
surfaceneutral986
surfaceContainerLowest to Highestneutral100, 96, 94, 92, 904, 10, 12, 17, 22
surfaceDim / surfaceBrightneutral87 / 986 / 24
onSurfaceneutral1090
onSurfaceVariantneutral variant3080
outline / outlineVariantneutral variant50 / 8060 / 30
inverseSurface / onInverseSurfaceneutral20 / 9590 / 20
inversePrimaryprimary8040
scrim / shadowneutral00

How to generate a Material 3 ColorScheme from a seed colour

  1. 1
    Enter the seedType a HEX colour or pick one. This is your brand colour or the colour you want the app to lean toward.
  2. 2
    Choose the variant and brightnessKeep tonalSpot to match ColorScheme.fromSeed. Pick light, dark or both; with both you get two schemes you can pass to ThemeData and darkTheme.
  3. 3
    Add your own secondary and tertiary seeds if you have themTick the box and enter them. The output then uses the explicit ColorScheme, since fromSeed takes a single seed.
  4. 4
    Check the contrast table and copyRead the ratios under the preview, then copy the Dart, Compose or CSS output. Paste the Dart into your theme file and pass the schemes to ThemeData(colorScheme: ...).

Frequently asked questions

Will this match what ColorScheme.fromSeed gives in my Flutter app?
It matches the current material-color-utilities library, the one Flutter's fromSeed is built on: we compared every role for 24 seeds and 4 variants against it and found no difference. Flutter pins its own version of that library, and the roles changed between releases (for example the light onPrimaryContainer moved from tone 10 to tone 30), so an older Flutter can show slightly different on-container colours for the same seed. The explicit ColorScheme in the output removes that dependency.
Why is my primary colour not my seed colour?
tonalSpot builds the primary palette at chroma 36 and then picks tone 40 (light) or 80 (dark). Your seed's tone and chroma are replaced, only its hue is kept. If your brand colour must appear exactly, set it as an override: ColorScheme.fromSeed(seedColor: brand).copyWith(primary: brand), and check the contrast of onPrimary against it.
What is the difference between HCT and HSL?
HSL lightness is computed from RGB and does not track how bright a colour looks: yellow and blue at the same HSL lightness are very different in perceived brightness. HCT's tone is the L* of CIELAB, so equal tones look equally light. That is why Material can guarantee that tone 40 against tone 100 gives at least 4.5:1 contrast for any hue.
How do I use the dark scheme in Flutter?
Build both schemes and pass them to MaterialApp: theme: ThemeData(colorScheme: lightColorScheme), darkTheme: ThemeData(colorScheme: darkColorScheme), themeMode: ThemeMode.system. Choose “Light and dark” here to get both constants in one go.
What are the surfaceContainer roles for?
Material 3 replaced the elevation-based surface tint with five tonal surfaces: surfaceContainerLowest, Low, the plain container, High and Highest, plus surfaceDim and surfaceBright. Cards, sheets and menus sit on these. Flutter's Card and NavigationBar use them in current versions, so a missing role shows up as a wrong background rather than a compile error.
Can I use these colours in Jetpack Compose and on the web too?
Yes. The Compose output declares each role as a Color and a lightColorScheme / darkColorScheme call, and the CSS output uses the --md-sys-color-* names Material Theme Builder exports. The values are identical across all three, which keeps a Flutter app, an Android app and a website in step.

Sources

Related tools

See all 135 free tools

Need a custom dev tool for your team?

We build internal tools, dashboards, APIs, and SaaS platforms. If you can describe it, we can ship it.

Built by CountryDevs · No signup · No ads · We count visits, never what you enter