Color class

Available extensions
Annotations

Constructors

Color({required int r, required int g, required int b, int a = 255, Color? darker, Color? lighter})
const
Color.fromHex({required String code})
Construct the color from a hex code string, of the format #RRGGBB.
factory
Color.fromOther({required Color color, Color? darker, Color? lighter})

Properties

a → int
final
b → int
final
darker → Color
no setter
g → int
final
hashCode → int
The hash code for this object.
no setteroverride
hexString → String
Converts the character into a #RGB hex string.
no setter
lighter → Color
no setter
r → int
final
rgbaHexString → String
Converts the character into a #RGBA hex string.
no setter
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
toDartColor() → Color

Available on Color, provided by the ColorExtensions extension

Converts a common color to a Flutter color.
toString() → String
A string representation of this object.
override
withAlpha(double alpha) → Color

Available on Color, provided by the ColorExtensions extension

Returns a new color with the alpha channel multiplied by the given value.

Operators

operator ==(Object other) → bool
The equality operator.
override

Constants

black → const Color
transparent → const Color
white → const Color