Colors class
The Fluent Design color palette.
Colors provides a set of predefined colors matching the Windows system palette. These colors are designed to work well together and with Windows UI elements.
{@tool snippet} Using standard colors:
Container(
color: Colors.blue,
child: Text('Blue background'),
)
{@end-tool}
{@tool snippet} Using accent color shades:
// Access specific shades of accent colors
final lightBlue = Colors.blue.light;
final darkBlue = Colors.blue.dark;
{@end-tool}
Shaded colors
Some colors like grey have numbered shades (e.g., Colors.grey[120]).
Accent colors like blue, red, green have named shades (e.g.,
Colors.blue.light, Colors.blue.darker).
See also:
- AccentColor, for colors with light/dark shade variants
- ShadedColor, for colors with numbered shade variants
- learn.microsoft.com/en-us/windows/apps/design/style/color
Constructors
- Colors()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
accentColors
→ List<
AccentColor> -
A list of all the accent colors provided by this library.
final
- blue → AccentColor
-
The blue accent color.
final
- errorSecondaryColor → AccentColor
-
The secondary color for error.
final
- green → AccentColor
-
The green accent color.
final
- magenta → AccentColor
-
The magenta accent color.
final
- orange → AccentColor
-
The orange accent color.
final
- purple → AccentColor
-
The purple accent color.
final
- red → AccentColor
-
The red accent color.
final
- successSecondaryColor → AccentColor
-
The secondary color for success.
final
- teal → AccentColor
-
The teal accent color.
final
- warningSecondaryColor → AccentColor
-
The secondary color for warning.
final
- yellow → AccentColor
-
The yellow accent color.
final
Constants
- black → const Color
- A black opaque color.
- errorPrimaryColor → const Color
- The primary color for error.
- grey → const ShadedColor
- The grey color.
- successPrimaryColor → const Color
- The primary color for success.
- transparent → const Color
- The transparent color. This should not be used in animations because it'll cause a weird effect.
- warningPrimaryColor → const Color
- The primary color for warning.
- white → const Color
- A opaque white color.