An immutable 32 bit color value in ARGB
Static Methods
Constructors
- Color(int value)
-
Construct a color from the lower 32 bits of an int.
const - Color.fromARGB(int a, int r, int g, int b)
-
Construct a color from the lower 8 bits of four integers.
const - Color.fromRGBO(int r, int g, int b, double opacity)
-
Create a color from red, green, blue, and opacity, similar to
rgba()
in CSS.const
Properties
- alpha → int
-
The alpha channel of this color in an 8 bit value.
read-only - blue → int
-
The blue channel of this color in an 8 bit value.
read-only - green → int
-
The green channel of this color in an 8 bit value.
read-only - hashCode → int
-
read-only
- opacity → double
-
The alpha channel of this color as a double.
read-only - red → int
-
The red channel of this color in an 8 bit value.
read-only - value → int
-
A 32 bit value representing this color.
read-only - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
Methods
-
toString(
) → String -
Returns a string representation of this object.
-
withAlpha(
int a) → Color -
Returns a new color that matches this color with the alpha channel replaced with a (which ranges from 0 to 255).
-
withBlue(
int b) → Color -
Returns a new color that matches this color with the blue channel replaced with b.
-
withGreen(
int g) → Color -
Returns a new color that matches this color with the green channel replaced with g.
-
withOpacity(
double opacity) → Color -
Returns a new color that matches this color with the alpha channel replaced with the given opacity (which ranges from 0.0 to 1.0).
-
withRed(
int r) → Color -
Returns a new color that matches this color with the red channel replaced with r.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited