GradientColor class

You can add gradient elements to the theme's color settings.

Two color gradients can be set by passing mainColor and subColor.

To use it as a gradient, it must be converted to a gradient object using Color.toLinearGradient.

When used as a normal Color, the color of mainColor is used.

テーマの色設定にグラデーションの要素を加えることができます。

mainColorとsubColorを渡すことで2色のグラデーションを設定可能です。

グラデーションとして用いるためにはColor.toLinearGradientを利用してグラデーションオブジェクトに変換する必要があります。

通常のColorとして利用される場合、mainColorの色が使用されます。

Implemented types
Available extensions
Annotations

Constructors

GradientColor(Color mainColor, Color subColor)
You can add gradient elements to the theme's color settings.
const

Properties

a → double
The alpha channel of this color.
no setteroverride
alpha → int
The alpha channel of this color in an 8 bit value.
no setteroverride
b → double
The blue channel of this color.
no setteroverride
blue → int
The blue channel of this color in an 8 bit value.
no setteroverride
colorSpace → ColorSpace
The color space of this color.
no setteroverride
g → double
The green channel of this color.
no setteroverride
green → int
The green channel of this color in an 8 bit value.
no setteroverride
hashCode → int
The hash code for this object.
no setteroverride
isGradient → bool

Available on Color, provided by the ThemeColorExtensions extension

Returns true if Color is GradientColor.
no setter
mainColor → Color
The color of the starting point of the gradient color.
final
opacity → double
The alpha channel of this color as a double.
no setteroverride
r → double
The red channel of this color.
no setteroverride
red → int
The red channel of this color in an 8 bit value.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subColor → Color
The color at the end of the gradient color.
final
value → int
A 32 bit value representing this color.
no setteroverride

Methods

computeLuminance() → double
Returns a brightness value between 0 for darkest and 1 for lightest.
override
darken([double amount = 0.1]) → Color

Available on Color, provided by the ThemeColorExtensions extension

Darkens Color by the amount of amount.
lighten([double amount = 0.1]) → Color

Available on Color, provided by the ThemeColorExtensions extension

Make Color brighter by the amount of amount.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toARGB32() → int
Returns a 32-bit value representing this color.
override
toInt() → int

Available on Color, provided by the ThemeColorExtensions extension

Convert Color to int.
toLinearGradient({AlignmentGeometry begin = Alignment.centerLeft, AlignmentGeometry end = Alignment.centerRight, TileMode tileMode = TileMode.clamp, List<double>? stops, GradientTransform? transform}) → Gradient

Available on Color, provided by the ThemeColorExtensions extension

Detects GradientColor stored in Color and creates LinearGradient.
toString() → String
A string representation of this object.
override
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).
override
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).
override
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).
override
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).
override
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).
override
withValues({double? alpha, double? red, double? green, double? blue, ColorSpace? colorSpace}) → Color
Returns a new color with the provided components updated.
override

Operators

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