AccentColor class
An accent color is a color that can have multiple shades. It's similar to ShadedColor and ColorSwatch, but it has helper methods to help you access the color variant you want easily. These shades may not be accessible on every accent color.
The fluent_ui library already provides some accent colors by default:
- Colors.yellow
- Colors.orange
- Colors.red
- Colors.magenta
- Colors.purple
- Colors.blue
- Colors.teal
- Colors.green
Use Colors.accentColors to get all the accent colors provided by default.
- Inheritance
-
- Object
- Color
- ColorSwatch<
String> - AccentColor
- Available Extensions
Constructors
-
AccentColor(String primary, Map<
String, Color> swatch) - Creates a new accent color.
-
AccentColor.swatch(Map<
String, Color> swatch) - Creates a new accent color based on a swatch
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
- dark → Color
-
The dark shade of the color.
no setter
- darker → Color
-
The darker shade of the color.
no setter
- darkest → Color
-
The darkest shade of the color.
no setter
- 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
- light → Color
-
The light shade of the color.
no setter
- lighter → Color
-
The lighter shade of the color.
no setter
- lightest → Color
-
The lighest shade of the color
no setter
- normal → Color
-
The default shade of the color.
no setter
- opacity → double
-
The alpha channel of this color as a double.
no setterinherited
- primary → String
-
The default shade for this color. This can't be null
final
- 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
-
swatch
→ Map<
String, Color> -
The avaiable shades for this color. This can't be null nor empty
final
- 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
-
defaultBrushFor(
Brightness brightness) → Color - Get the default brush for this accent color based on the brightness.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
secondaryBrushFor(
Brightness brightness) → Color - Get the secondary brush for this accent color based on the brightness.
-
tertiaryBrushFor(
Brightness brightness) → Color - Get the tertiary brush for this accent color based on the brightness.
-
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 [](
String index) → Color? -
Returns an element of the swatch table.
inherited
Static Methods
-
lerp(
AccentColor a, AccentColor b, double t) → AccentColor -
Lerp between two accent colors.
override