Colors class

Color and ColorSwatch constants which represent Material design's color palette.

Instead of using an absolute color from these palettes, consider using Theme.of to obtain the local ThemeData structure, which exposes the colors selected for the current theme, such as ThemeData.primaryColor and ThemeData.accentColor (among many others).

Most swatches have colors from 100 to 900 in increments of one hundred, plus the color 50. The smaller the number, the more pale the color. The greater the number, the darker the color. The accent swatches (e.g. redAccent) only have the values 100, 200, 400, and 700.

In addition, a series of blacks and whites with common opacities are available. For example, black54 is a pure black with 54% opacity.

To select a specific color from one of the swatches, index into the swatch using an integer for the specific color desired, as follows:
Color selection = Colors.green[400]; // Selects a mid-range green.

Each ColorSwatch constant is a color and can used directly. For example:
Container(
  color: Colors.blue, // same as Colors.blue[500] or Colors.blue.shade500
)

Color palettes

Blacks and whites

These colors are identified by their transparency. The low transparency levels (e.g. Colors.white12 and Colors.white10) are very hard to see and should be avoided in general. They are intended for very subtle effects.

The Colors.transparent color isn't shown here because it is entirely invisible!

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Constants

accents → const List<MaterialAccentColor>
The material design accent color swatches.
const <MaterialAccentColor> [redAccent, pinkAccent, purpleAccent, deepPurpleAccent, indigoAccent, blueAccent, lightBlueAccent, cyanAccent, tealAccent, greenAccent, lightGreenAccent, limeAccent, …
amber → const MaterialColor
The amber primary color and swatch. [...]
const MaterialColor(_amberPrimaryValue, const <int, Color> {50 : const Color(0xFFFFF8E1), 100 : const Color(0xFFFFECB3), 200 : const Color(0xFFFFE082), 300 : const Color(0xFFFFD54F), 400 : const…
amberAccent → const MaterialAccentColor
The amber accent color and swatch. [...]
const MaterialAccentColor(_amberAccentPrimaryValue, const <int, Color> {100 : const Color(0xFFFFE57F), 200 : const Color(_amberAccentPrimaryValue), 400 : const Color(0xFFFFC400), 700 : const Col…
black → const Color
Completely opaque black. [...]
const Color(0xFF000000)
black12 → const Color
Black with 12% opacity. [...]
const Color(0x1F000000)
black26 → const Color
Black with 26% opacity. [...]
const Color(0x42000000)
black38 → const Color
Black with 38% opacity. [...]
const Color(0x61000000)
black45 → const Color
Black with 45% opacity. [...]
const Color(0x73000000)
black54 → const Color
Black with 54% opacity. [...]
const Color(0x8A000000)
black87 → const Color
Black with 87% opacity. [...]
const Color(0xDD000000)
blue → const MaterialColor
The blue primary color and swatch. [...]
const MaterialColor(_bluePrimaryValue, const <int, Color> {50 : const Color(0xFFE3F2FD), 100 : const Color(0xFFBBDEFB), 200 : const Color(0xFF90CAF9), 300 : const Color(0xFF64B5F6), 400 : const …
blueAccent → const MaterialAccentColor
The blue accent color and swatch. [...]
const MaterialAccentColor(_blueAccentPrimaryValue, const <int, Color> {100 : const Color(0xFF82B1FF), 200 : const Color(_blueAccentPrimaryValue), 400 : const Color(0xFF2979FF), 700 : const Color…
blueGrey → const MaterialColor
The blue-grey primary color and swatch. [...]
const MaterialColor(_blueGreyPrimaryValue, const <int, Color> {50 : const Color(0xFFECEFF1), 100 : const Color(0xFFCFD8DC), 200 : const Color(0xFFB0BEC5), 300 : const Color(0xFF90A4AE), 400 : co…
brown → const MaterialColor
The brown primary color and swatch. [...]
const MaterialColor(_brownPrimaryValue, const <int, Color> {50 : const Color(0xFFEFEBE9), 100 : const Color(0xFFD7CCC8), 200 : const Color(0xFFBCAAA4), 300 : const Color(0xFFA1887F), 400 : const…
cyan → const MaterialColor
The cyan primary color and swatch. [...]
const MaterialColor(_cyanPrimaryValue, const <int, Color> {50 : const Color(0xFFE0F7FA), 100 : const Color(0xFFB2EBF2), 200 : const Color(0xFF80DEEA), 300 : const Color(0xFF4DD0E1), 400 : const …
cyanAccent → const MaterialAccentColor
The cyan accent color and swatch. [...]
const MaterialAccentColor(_cyanAccentPrimaryValue, const <int, Color> {100 : const Color(0xFF84FFFF), 200 : const Color(_cyanAccentPrimaryValue), 400 : const Color(0xFF00E5FF), 700 : const Color…
deepOrange → const MaterialColor
The deep orange primary color and swatch. [...]
const MaterialColor(_deepOrangePrimaryValue, const <int, Color> {50 : const Color(0xFFFBE9E7), 100 : const Color(0xFFFFCCBC), 200 : const Color(0xFFFFAB91), 300 : const Color(0xFFFF8A65), 400 : …
deepOrangeAccent → const MaterialAccentColor
The deep orange accent color and swatch. [...]
const MaterialAccentColor(_deepOrangeAccentPrimaryValue, const <int, Color> {100 : const Color(0xFFFF9E80), 200 : const Color(_deepOrangeAccentPrimaryValue), 400 : const Color(0xFFFF3D00), 700 :…
deepPurple → const MaterialColor
The deep purple primary color and swatch. [...]
const MaterialColor(_deepPurplePrimaryValue, const <int, Color> {50 : const Color(0xFFEDE7F6), 100 : const Color(0xFFD1C4E9), 200 : const Color(0xFFB39DDB), 300 : const Color(0xFF9575CD), 400 : …
deepPurpleAccent → const MaterialAccentColor
The deep purple accent color and swatch. [...]
const MaterialAccentColor(_deepPurpleAccentPrimaryValue, const <int, Color> {100 : const Color(0xFFB388FF), 200 : const Color(_deepPurpleAccentPrimaryValue), 400 : const Color(0xFF651FFF), 700 :…
green → const MaterialColor
The green primary color and swatch. [...]
const MaterialColor(_greenPrimaryValue, const <int, Color> {50 : const Color(0xFFE8F5E9), 100 : const Color(0xFFC8E6C9), 200 : const Color(0xFFA5D6A7), 300 : const Color(0xFF81C784), 400 : const…
greenAccent → const MaterialAccentColor
The green accent color and swatch. [...]
const MaterialAccentColor(_greenAccentPrimaryValue, const <int, Color> {100 : const Color(0xFFB9F6CA), 200 : const Color(_greenAccentPrimaryValue), 400 : const Color(0xFF00E676), 700 : const Col…
grey → const MaterialColor
The grey primary color and swatch. [...]
const MaterialColor(_greyPrimaryValue, const <int, Color> {50 : const Color(0xFFFAFAFA), 100 : const Color(0xFFF5F5F5), 200 : const Color(0xFFEEEEEE), 300 : const Color(0xFFE0E0E0), 350 : const …
indigo → const MaterialColor
The indigo primary color and swatch. [...]
const MaterialColor(_indigoPrimaryValue, const <int, Color> {50 : const Color(0xFFE8EAF6), 100 : const Color(0xFFC5CAE9), 200 : const Color(0xFF9FA8DA), 300 : const Color(0xFF7986CB), 400 : cons…
indigoAccent → const MaterialAccentColor
The indigo accent color and swatch. [...]
const MaterialAccentColor(_indigoAccentPrimaryValue, const <int, Color> {100 : const Color(0xFF8C9EFF), 200 : const Color(_indigoAccentPrimaryValue), 400 : const Color(0xFF3D5AFE), 700 : const C…
lightBlue → const MaterialColor
The light blue primary color and swatch. [...]
const MaterialColor(_lightBluePrimaryValue, const <int, Color> {50 : const Color(0xFFE1F5FE), 100 : const Color(0xFFB3E5FC), 200 : const Color(0xFF81D4FA), 300 : const Color(0xFF4FC3F7), 400 : c…
lightBlueAccent → const MaterialAccentColor
The light blue accent swatch. [...]
const MaterialAccentColor(_lightBlueAccentPrimaryValue, const <int, Color> {100 : const Color(0xFF80D8FF), 200 : const Color(_lightBlueAccentPrimaryValue), 400 : const Color(0xFF00B0FF), 700 : c…
lightGreen → const MaterialColor
The light green primary color and swatch. [...]
const MaterialColor(_lightGreenPrimaryValue, const <int, Color> {50 : const Color(0xFFF1F8E9), 100 : const Color(0xFFDCEDC8), 200 : const Color(0xFFC5E1A5), 300 : const Color(0xFFAED581), 400 : …
lightGreenAccent → const MaterialAccentColor
The light green accent color and swatch. [...]
const MaterialAccentColor(_lightGreenAccentPrimaryValue, const <int, Color> {100 : const Color(0xFFCCFF90), 200 : const Color(_lightGreenAccentPrimaryValue), 400 : const Color(0xFF76FF03), 700 :…
lime → const MaterialColor
The lime primary color and swatch. [...]
const MaterialColor(_limePrimaryValue, const <int, Color> {50 : const Color(0xFFF9FBE7), 100 : const Color(0xFFF0F4C3), 200 : const Color(0xFFE6EE9C), 300 : const Color(0xFFDCE775), 400 : const …
limeAccent → const MaterialAccentColor
The lime accent primary color and swatch. [...]
const MaterialAccentColor(_limeAccentPrimaryValue, const <int, Color> {100 : const Color(0xFFF4FF81), 200 : const Color(_limeAccentPrimaryValue), 400 : const Color(0xFFC6FF00), 700 : const Color…
orange → const MaterialColor
The orange primary color and swatch. [...]
const MaterialColor(_orangePrimaryValue, const <int, Color> {50 : const Color(0xFFFFF3E0), 100 : const Color(0xFFFFE0B2), 200 : const Color(0xFFFFCC80), 300 : const Color(0xFFFFB74D), 400 : cons…
orangeAccent → const MaterialAccentColor
The orange accent color and swatch. [...]
const MaterialAccentColor(_orangeAccentPrimaryValue, const <int, Color> {100 : const Color(0xFFFFD180), 200 : const Color(_orangeAccentPrimaryValue), 400 : const Color(0xFFFF9100), 700 : const C…
pink → const MaterialColor
The pink primary color and swatch. [...]
const MaterialColor(_pinkPrimaryValue, const <int, Color> {50 : const Color(0xFFFCE4EC), 100 : const Color(0xFFF8BBD0), 200 : const Color(0xFFF48FB1), 300 : const Color(0xFFF06292), 400 : const …
pinkAccent → const MaterialAccentColor
The pink accent color swatch. [...]
const MaterialAccentColor(_pinkAccentPrimaryValue, const <int, Color> {100 : const Color(0xFFFF80AB), 200 : const Color(_pinkAccentPrimaryValue), 400 : const Color(0xFFF50057), 700 : const Color…
primaries → const List<MaterialColor>
The material design primary color swatches, excluding grey.
const <MaterialColor> [red, pink, purple, deepPurple, indigo, blue, lightBlue, cyan, teal, green, lightGreen, lime, yellow, amber, orange, deepOrange, brown, blueGrey]
purple → const MaterialColor
The purple primary color and swatch. [...]
const MaterialColor(_purplePrimaryValue, const <int, Color> {50 : const Color(0xFFF3E5F5), 100 : const Color(0xFFE1BEE7), 200 : const Color(0xFFCE93D8), 300 : const Color(0xFFBA68C8), 400 : cons…
purpleAccent → const MaterialAccentColor
The purple accent color and swatch. [...]
const MaterialAccentColor(_purpleAccentPrimaryValue, const <int, Color> {100 : const Color(0xFFEA80FC), 200 : const Color(_purpleAccentPrimaryValue), 400 : const Color(0xFFD500F9), 700 : const C…
red → const MaterialColor
The red primary color and swatch. [...]
const MaterialColor(_redPrimaryValue, const <int, Color> {50 : const Color(0xFFFFEBEE), 100 : const Color(0xFFFFCDD2), 200 : const Color(0xFFEF9A9A), 300 : const Color(0xFFE57373), 400 : const C…
redAccent → const MaterialAccentColor
The red accent swatch. [...]
const MaterialAccentColor(_redAccentValue, const <int, Color> {100 : const Color(0xFFFF8A80), 200 : const Color(_redAccentValue), 400 : const Color(0xFFFF1744), 700 : const Color(0xFFD50000)})
teal → const MaterialColor
The teal primary color and swatch. [...]
const MaterialColor(_tealPrimaryValue, const <int, Color> {50 : const Color(0xFFE0F2F1), 100 : const Color(0xFFB2DFDB), 200 : const Color(0xFF80CBC4), 300 : const Color(0xFF4DB6AC), 400 : const …
tealAccent → const MaterialAccentColor
The teal accent color and swatch. [...]
const MaterialAccentColor(_tealAccentPrimaryValue, const <int, Color> {100 : const Color(0xFFA7FFEB), 200 : const Color(_tealAccentPrimaryValue), 400 : const Color(0xFF1DE9B6), 700 : const Color…
transparent → const Color
Completely invisible.
const Color(0x00000000)
white → const Color
Completely opaque white. [...]
const Color(0xFFFFFFFF)
white10 → const Color
White with 10% opacity. [...]
const Color(0x1AFFFFFF)
white12 → const Color
White with 12% opacity. [...]
const Color(0x1FFFFFFF)
white24 → const Color
White with 24% opacity. [...]
const Color(0x3DFFFFFF)
white30 → const Color
White with 32% opacity. [...]
const Color(0x4DFFFFFF)
white54 → const Color
White with 54% opacity. [...]
const Color(0x8AFFFFFF)
white70 → const Color
White with 70% opacity. [...]
const Color(0xB3FFFFFF)
yellow → const MaterialColor
The yellow primary color and swatch. [...]
const MaterialColor(_yellowPrimaryValue, const <int, Color> {50 : const Color(0xFFFFFDE7), 100 : const Color(0xFFFFF9C4), 200 : const Color(0xFFFFF59D), 300 : const Color(0xFFFFF176), 400 : cons…
yellowAccent → const MaterialAccentColor
The yellow accent color and swatch. [...]
const MaterialAccentColor(_yellowAccentPrimaryValue, const <int, Color> {100 : const Color(0xFFFFFF8D), 200 : const Color(_yellowAccentPrimaryValue), 400 : const Color(0xFFFFEA00), 700 : const C…