material_color_utilities library

Material Color Utilities

Algorithms and utilities that power the Material Design 3 (M3) color system, including choosing theme colors from images and creating tones of colors; all in a new color space.

Classes

Blend
Functions for blending in HCT and CAM16.
Cam16
CAM16, a color appearance model. Colors are not just defined by their hex code, but rather, a hex code and viewing conditions.
ColorSpec
An interface defining all the necessary methods that could be different between specs.
ColorSpec2021
ColorSpec implementation for the 2021 spec.
ColorSpec2025
ColorSpec implementation for the 2025 spec.
ColorSpecs
A utility class to get the correct color spec for a given spec version.
ColorUtils
Contrast
Color science for contrast utilities.
ContrastCurve
A class containing a value that changes with the contrast level.
CorePalettes
Comprises foundational palettes to build a color scheme.
DislikeAnalyzer
Check and/or fix universally disliked colors.
DynamicColor
A color that adjusts itself based on UI state, represented by DynamicScheme.
DynamicScheme
Provides important settings for creating colors dynamically, and 6 color palettes.
Hct
HctSolver
MaterialDynamicColors
MathUtils
PointProvider
An interface to allow use of different color spaces by quantizers.
PointProviderLab
Provides conversions needed for K-Means quantization. Converting input to points, and converting the final state of the K-Means algorithm to colors.
Quantizer
QuantizerCelebi
QuantizerMap
QuantizerResult
QuantizerWsmeans
QuantizerWu
SchemeContent
A scheme that places the source color in Scheme.primaryContainer.
SchemeExpressive
A playful theme - the source color's hue does not appear in the theme.
SchemeFidelity
A scheme that places the source color in Scheme.primaryContainer.
SchemeFruitSalad
A playful theme - the source color's hue does not appear in the theme.
SchemeMonochrome
A monochrome theme, colors are purely black / white / gray.
SchemeNeutral
A theme that's slightly more chromatic than monochrome, which is purely black / white / gray.
SchemeRainbow
A playful theme - the source color's hue does not appear in the theme.
SchemeTonalSpot
A calm theme, sedated colors that aren't particularly chromatic.
SchemeVibrant
A loud theme, colorfulness is maximum for Primary palette, increased for others.
Score
Given a large set of colors, remove colors that are unsuitable for a UI theme, and rank the rest based on suitability.
StringUtils
TemperatureCache
TonalPalette
A convenience class for retrieving colors that are in hue and chroma, but vary in tone.
ToneDeltaPair
Documents a constraint between two DynamicColors, in which their tones must have a certain distance from each other.
ViewingConditions

Enums

DeltaConstraint
Describes how to fulfill a tone delta pair constraint.
Platform
The platform on which this scheme is intended to be used.
SpecVersion
All available spec versions.
TonePolarity
Describes the relationship in lightness between two colors.
Variant
Themes for Dynamic Color.

Typedefs

DynamicSchemeCallback<T> = T Function(DynamicScheme scheme)