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 shade you want easily. These shades may not be accessible on every accent color.
- Inheritance
-
- Object
- Color
- ColorSwatch<
String> - AccentColor
- Available extensions
Constructors
-
AccentColor.new(String primary, Map<
String, Color> swatch) - Create a new accent color.
Properties
- a → double
-
The alpha channel of this color.
finalinherited
- alpha → int
-
The alpha channel of this color in an 8 bit value.
no setterinherited
- b → double
-
The blue channel of this color.
finalinherited
- blue → int
-
The blue channel of this color in an 8 bit value.
no setterinherited
- colorSpace → ColorSpace
-
The color space of this color.
finalinherited
- 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
- g → double
-
The green channel of this color.
finalinherited
- 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
-
keys
→ Iterable<
String> -
Returns the valid keys for accessing operator[].
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
- r → double
-
The red channel of this color.
finalinherited
- 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.
no setterinherited
Methods
-
computeLuminance(
) → double -
Returns a brightness value between 0 for darkest and 1 for lightest.
inherited
-
darken(
double amount) → Color - Range amout from 0.1 until 1
-
lighten(
double amount) → Color - Range amout from 0.1 until 1
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolveFrom(
BuildContext context, [Brightness? bright]) → Color -
resolveFromBrightness(
Brightness brightness, {int level = 0}) → Color -
resolveFromReverseBrightness(
Brightness brightness, {int level = 0}) → Color -
toARGB32(
) → int -
Returns a 32-bit value representing this color.
inherited
-
toHex(
{bool leadingHashSign = true}) → String -
Available on Color, provided by the HexColor extension
Prefixes a hash sign ifleadingHashSign
is set totrue
(default istrue
). -
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 -
withValues(
{double? alpha, double? red, double? green, double? blue, ColorSpace? colorSpace}) → Color -
Returns a new color with the provided components updated.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String key) → Color? -
Returns an element of the swatch table.
inherited
Static Methods
-
lerp(
AccentColor? a, AccentColor? b, double t) → AccentColor -
Linearly interpolate between two ColorSwatches.
override
-
resolve(
Color resolvable, BuildContext context) → Color