MsMaterialColor class
MsMaterialColor
is a simple solution to creation a MaterialColor
with 10 shades variants 50, 100, 200, ...900 use only one base color.
See also:
- MaterialColor, which defines a single color as well a color swatch with ten shades of the color..
- Inheritance
-
- Object
- Color
- ColorSwatch<
int> - MaterialColor
- MsMaterialColor
Constructors
- MsMaterialColor(int primary)
- MsMaterialColor.fromARGB(int a, int r, int g, int b)
-
Construct a MsMaterialColor from the lower 8 bits of four integers.
factory
- MsMaterialColor.fromHexString(String hexString)
-
Construct a MsMaterialColor from a String with hex color
factory
- MsMaterialColor.fromRGBO(int r, int g, int b, double opacity)
-
Create a MsMaterialColor from red, green, blue, and opacity, similar to
rgba()
in CSS.factory
Properties
- alpha → int
-
The alpha channel of this color in an 8 bit value.
no setterinherited
- blue → int
-
The blue channel of this color in an 8 bit value.
no setterinherited
- green → int
-
The green channel of this color in an 8 bit value.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- opacity → double
-
The alpha channel of this color as a double.
no setterinherited
- red → int
-
The red channel of this color in an 8 bit value.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shade50 → Color
-
The lightest shade.
no setterinherited
- shade100 → Color
-
The second lightest shade.
no setterinherited
- shade200 → Color
-
The third lightest shade.
no setterinherited
- shade300 → Color
-
The fourth lightest shade.
no setterinherited
- shade400 → Color
-
The fifth lightest shade.
no setterinherited
- shade500 → Color
-
The default shade.
no setterinherited
- shade600 → Color
-
The fourth darkest shade.
no setterinherited
- shade700 → Color
-
The third darkest shade.
no setterinherited
- shade800 → Color
-
The second darkest shade.
no setterinherited
- shade900 → Color
-
The darkest shade.
no setterinherited
- value → int
-
A 32 bit value representing this color.
finalinherited
Methods
-
computeLuminance(
) → double -
Returns a brightness value between 0 for darkest and 1 for lightest.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
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).inherited -
withBlue(
int b) → Color -
Returns a new color that matches this color with the blue channel replaced
with
b
(which ranges from 0 to 255).inherited -
withGreen(
int g) → Color -
Returns a new color that matches this color with the green channel
replaced with
g
(which ranges from 0 to 255).inherited -
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).inherited -
withRed(
int r) → Color -
Returns a new color that matches this color with the red channel replaced
with
r
(which ranges from 0 to 255).inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int index) → Color? -
Returns an element of the swatch table.
inherited