pub struct Colors;Expand description
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.colorScheme, which defines
the colors that most of the Material components use by default.
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. RED_ACCENT) 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!
See also:
Implementations§
Source§impl Colors
impl Colors
Sourcepub const TRANSPARENT: Color
pub const TRANSPARENT: Color
Completely invisible.
Sourcepub const BLACK87: Color
pub const BLACK87: Color
Black with 87% opacity.
This is a good contrasting color for text in light themes.

See also:
Sourcepub const BLACK54: Color
pub const BLACK54: Color
Black with 54% opacity.
This is a color commonly used for headings in light themes. It’s also used as the mask color behind dialogs.

See also:
Sourcepub const BLACK38: Color
pub const BLACK38: Color
Black with 38% opacity.
For light themes, i.e. when the Theme’s ThemeData.brightness is
Brightness.light, this color is used for disabled icons and for
placeholder text in DataTable.

See also:
Sourcepub const BLACK26: Color
pub const BLACK26: Color
Black with 26% opacity.
Used for disabled radio buttons and the text of disabled flat buttons in light themes.

See also:
ThemeData.disabledColor, which uses this color by default in light themes.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.BLACK,BLACK87,BLACK54,BLACK45,BLACK38,BLACK12, which are variants on this color but with different opacities.
Sourcepub const WHITE: Color
pub const WHITE: Color
Completely opaque white.
This is a good contrasting color for the ThemeData.primaryColor in the
dark theme. See ThemeData.brightness.

See also:
Typography.white, which uses this color for its text styles.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.WHITE70,WHITE60,WHITE54,WHITE38,WHITE30,WHITE12,WHITE10, which are variants on this color but with different opacities.BLACK, a solid black color.TRANSPARENT, a fully-transparent color.
Sourcepub const WHITE70: Color
pub const WHITE70: Color
White with 70% opacity.
This is a color commonly used for headings in dark themes.

See also:
Typography.white, which uses this color for its text styles.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.WHITE,WHITE60,WHITE54,WHITE38,WHITE30,WHITE12,WHITE10, which are variants on this color but with different opacities.
Sourcepub const WHITE60: Color
pub const WHITE60: Color
White with 60% opacity.
Used for medium-emphasis text and hint text when ThemeData.brightness is
set to Brightness.dark.

See also:
Sourcepub const WHITE38: Color
pub const WHITE38: Color
White with 38% opacity.
Used for disabled radio buttons and the text of disabled flat buttons in dark themes.

See also:
ThemeData.disabledColor, which uses this color by default in dark themes.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.WHITE,WHITE60,WHITE54,WHITE70,WHITE30,WHITE12,WHITE10, which are variants on this color but with different opacities.
Sourcepub const RED: MaterialColor
pub const RED: MaterialColor
The red primary color and swatch.



Icon(
Icons.widgets,
color: Colors.red[400],
)See also:
RED_ACCENT, the corresponding accent colors.DEEP_ORANGEandPINK, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const RED_ACCENT: MaterialAccentColor
pub const RED_ACCENT: MaterialAccentColor
The red accent swatch.



Icon(
Icons.widgets,
color: Colors.redAccent[400],
)See also:
RED, the corresponding primary colors.DEEP_ORANGE_ACCENTandPINK_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const PINK: MaterialColor
pub const PINK: MaterialColor
The pink primary color and swatch.



Icon(
Icons.widgets,
color: Colors.pink[400],
)See also:
PINK_ACCENT, the corresponding accent colors.REDandPURPLE, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const PINK_ACCENT: MaterialAccentColor
pub const PINK_ACCENT: MaterialAccentColor
The pink accent color swatch.



Icon(
Icons.widgets,
color: Colors.pinkAccent[400],
)See also:
PINK, the corresponding primary colors.RED_ACCENTandPURPLE_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const PURPLE: MaterialColor
pub const PURPLE: MaterialColor
The purple primary color and swatch.



Icon(
Icons.widgets,
color: Colors.purple[400],
)See also:
PURPLE_ACCENT, the corresponding accent colors.DEEP_PURPLEandPINK, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const PURPLE_ACCENT: MaterialAccentColor
pub const PURPLE_ACCENT: MaterialAccentColor
The purple accent color and swatch.



Icon(
Icons.widgets,
color: Colors.purpleAccent[400],
)See also:
PURPLE, the corresponding primary colors.DEEP_PURPLE_ACCENTandPINK_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const DEEP_PURPLE: MaterialColor
pub const DEEP_PURPLE: MaterialColor
The deep purple primary color and swatch.



Icon(
Icons.widgets,
color: Colors.deepPurple[400],
)See also:
DEEP_PURPLE_ACCENT, the corresponding accent colors.PURPLEandINDIGO, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const DEEP_PURPLE_ACCENT: MaterialAccentColor
pub const DEEP_PURPLE_ACCENT: MaterialAccentColor
The deep purple accent color and swatch.



Icon(
Icons.widgets,
color: Colors.deepPurpleAccent[400],
)See also:
DEEP_PURPLE, the corresponding primary colors.PURPLE_ACCENTandINDIGO_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const INDIGO: MaterialColor
pub const INDIGO: MaterialColor
The indigo primary color and swatch.



Icon(
Icons.widgets,
color: Colors.indigo[400],
)See also:
INDIGO_ACCENT, the corresponding accent colors.BLUEandDEEP_PURPLE, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const INDIGO_ACCENT: MaterialAccentColor
pub const INDIGO_ACCENT: MaterialAccentColor
The indigo accent color and swatch.



Icon(
Icons.widgets,
color: Colors.indigoAccent[400],
)See also:
INDIGO, the corresponding primary colors.BLUE_ACCENTandDEEP_PURPLE_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const BLUE: MaterialColor
pub const BLUE: MaterialColor
The blue primary color and swatch.




Icon(
Icons.widgets,
color: Colors.blue[400],
)See also:
BLUE_ACCENT, the corresponding accent colors.INDIGO,LIGHT_BLUE, andBLUE_GREY, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const BLUE_ACCENT: MaterialAccentColor
pub const BLUE_ACCENT: MaterialAccentColor
The blue accent color and swatch.



Icon(
Icons.widgets,
color: Colors.blueAccent[400],
)See also:
BLUE, the corresponding primary colors.INDIGO_ACCENTandLIGHT_BLUE_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const LIGHT_BLUE: MaterialColor
pub const LIGHT_BLUE: MaterialColor
The light blue primary color and swatch.



Icon(
Icons.widgets,
color: Colors.lightBlue[400],
)See also:
LIGHT_BLUE_ACCENT, the corresponding accent colors.BLUEandCYAN, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const LIGHT_BLUE_ACCENT: MaterialAccentColor
pub const LIGHT_BLUE_ACCENT: MaterialAccentColor
The light blue accent swatch.



Icon(
Icons.widgets,
color: Colors.lightBlueAccent[400],
)See also:
LIGHT_BLUE, the corresponding primary colors.BLUE_ACCENTandCYAN_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const CYAN: MaterialColor
pub const CYAN: MaterialColor
The cyan primary color and swatch.




Icon(
Icons.widgets,
color: Colors.cyan[400],
)See also:
CYAN_ACCENT, the corresponding accent colors.LIGHT_BLUE,TEAL, andBLUE_GREY, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const CYAN_ACCENT: MaterialAccentColor
pub const CYAN_ACCENT: MaterialAccentColor
The cyan accent color and swatch.



Icon(
Icons.widgets,
color: Colors.cyanAccent[400],
)See also:
CYAN, the corresponding primary colors.LIGHT_BLUE_ACCENTandTEAL_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const TEAL: MaterialColor
pub const TEAL: MaterialColor
The teal primary color and swatch.



Icon(
Icons.widgets,
color: Colors.teal[400],
)See also:
TEAL_ACCENT, the corresponding accent colors.GREENandCYAN, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const TEAL_ACCENT: MaterialAccentColor
pub const TEAL_ACCENT: MaterialAccentColor
The teal accent color and swatch.



Icon(
Icons.widgets,
color: Colors.tealAccent[400],
)See also:
TEAL, the corresponding primary colors.GREEN_ACCENTandCYAN_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const GREEN: MaterialColor
pub const GREEN: MaterialColor
The green primary color and swatch.




Icon(
Icons.widgets,
color: Colors.green[400],
)See also:
GREEN_ACCENT, the corresponding accent colors.TEAL,LIGHT_GREEN, andLIME, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const GREEN_ACCENT: MaterialAccentColor
pub const GREEN_ACCENT: MaterialAccentColor
The green accent color and swatch.




Icon(
Icons.widgets,
color: Colors.greenAccent[400],
)See also:
GREEN, the corresponding primary colors.TEAL_ACCENT,LIGHT_GREEN_ACCENT, andLIME_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const LIGHT_GREEN: MaterialColor
pub const LIGHT_GREEN: MaterialColor
The light green primary color and swatch.



Icon(
Icons.widgets,
color: Colors.lightGreen[400],
)See also:
LIGHT_GREEN_ACCENT, the corresponding accent colors.GREENandLIME, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const LIGHT_GREEN_ACCENT: MaterialAccentColor
pub const LIGHT_GREEN_ACCENT: MaterialAccentColor
The light green accent color and swatch.



Icon(
Icons.widgets,
color: Colors.lightGreenAccent[400],
)See also:
LIGHT_GREEN, the corresponding primary colors.GREEN_ACCENTandLIME_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const LIME: MaterialColor
pub const LIME: MaterialColor
The lime primary color and swatch.



Icon(
Icons.widgets,
color: Colors.lime[400],
)See also:
LIME_ACCENT, the corresponding accent colors.LIGHT_GREENandYELLOW, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const LIME_ACCENT: MaterialAccentColor
pub const LIME_ACCENT: MaterialAccentColor
The lime accent primary color and swatch.



Icon(
Icons.widgets,
color: Colors.limeAccent[400],
)See also:
LIME, the corresponding primary colors.LIGHT_GREEN_ACCENTandYELLOW_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const YELLOW: MaterialColor
pub const YELLOW: MaterialColor
The yellow primary color and swatch.



Icon(
Icons.widgets,
color: Colors.yellow[400],
)See also:
YELLOW_ACCENT, the corresponding accent colors.LIMEandAMBER, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const YELLOW_ACCENT: MaterialAccentColor
pub const YELLOW_ACCENT: MaterialAccentColor
The yellow accent color and swatch.



Icon(
Icons.widgets,
color: Colors.yellowAccent[400],
)See also:
YELLOW, the corresponding primary colors.LIME_ACCENTandAMBER_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const AMBER: MaterialColor
pub const AMBER: MaterialColor
The amber primary color and swatch.



Icon(
Icons.widgets,
color: Colors.amber[400],
)See also:
AMBER_ACCENT, the corresponding accent colors.YELLOWandORANGE, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const AMBER_ACCENT: MaterialAccentColor
pub const AMBER_ACCENT: MaterialAccentColor
The amber accent color and swatch.



Icon(
Icons.widgets,
color: Colors.amberAccent[400],
)See also:
AMBER, the corresponding primary colors.YELLOW_ACCENTandORANGE_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const ORANGE: MaterialColor
pub const ORANGE: MaterialColor
The orange primary color and swatch.




Icon(
Icons.widgets,
color: Colors.orange[400],
)See also:
ORANGE_ACCENT, the corresponding accent colors.AMBER,DEEP_ORANGE, andBROWN, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const ORANGE_ACCENT: MaterialAccentColor
pub const ORANGE_ACCENT: MaterialAccentColor
The orange accent color and swatch.



Icon(
Icons.widgets,
color: Colors.orangeAccent[400],
)See also:
ORANGE, the corresponding primary colors.AMBER_ACCENTandDEEP_ORANGE_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const DEEP_ORANGE: MaterialColor
pub const DEEP_ORANGE: MaterialColor
The deep orange primary color and swatch.




Icon(
Icons.widgets,
color: Colors.deepOrange[400],
)See also:
DEEP_ORANGE_ACCENT, the corresponding accent colors.ORANGE,RED, andBROWN, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const DEEP_ORANGE_ACCENT: MaterialAccentColor
pub const DEEP_ORANGE_ACCENT: MaterialAccentColor
The deep orange accent color and swatch.



Icon(
Icons.widgets,
color: Colors.deepOrangeAccent[400],
)See also:
DEEP_ORANGE, the corresponding primary colors.ORANGE_ACCENTRED_ACCENT, similar colors.Theme.of, which allows you to select colors from the current theme rather than hard-coding colors in your build methods.
Sourcepub const BROWN: MaterialColor
pub const BROWN: MaterialColor
The brown primary color and swatch.



This swatch has no corresponding accent color and swatch.
Icon(
Icons.widgets,
color: Colors.brown[400],
)See also:
Sourcepub const GREY: MaterialColor
pub const GREY: MaterialColor
The grey primary color and swatch.



This swatch has no corresponding accent swatch.
This swatch, in addition to the values 50 and 100 to 900 in 100
increments, also features the special values 350 and 850. The 350 value is
used for raised button while pressed in light themes, and 850 is used for
the background color of the dark theme. See ThemeData.brightness.
Icon(
Icons.widgets,
color: Colors.grey[400],
)See also:
Sourcepub const BLUE_GREY: MaterialColor
pub const BLUE_GREY: MaterialColor
The blue-grey primary color and swatch.




This swatch has no corresponding accent swatch.
Icon(
Icons.widgets,
color: Colors.blueGrey[400],
)See also:
Sourcepub const PRIMARIES: &'static [MaterialColor]
pub const PRIMARIES: &'static [MaterialColor]
The Material Design primary color swatches, excluding grey.
Sourcepub const ACCENTS: &'static [MaterialAccentColor]
pub const ACCENTS: &'static [MaterialAccentColor]
The Material Design accent color swatches.