ColorMatrix class final
A 4x5 RGBA color matrix.
Values are stored row-major:
- row 0 transforms red
- row 1 transforms green
- row 2 transforms blue
- row 3 transforms alpha
Each row contains four coefficients plus one additive bias term.
Constructors
-
ColorMatrix(List<
double> values) - ColorMatrix.attenuation(double amount)
-
Returns an attenuation transform that scales RGB channels by
amount.factory - ColorMatrix.gain(double amount)
-
Returns a gain transform that scales RGB channels by
amount.factory - ColorMatrix.grayscale()
-
Returns a grayscale transform using sRGB luminance coefficients.
factory
- ColorMatrix.invert()
-
Returns an invert transform.
factory
- ColorMatrix.multiply(UvColor color)
-
Returns a multiply-style transform using
coloras the multiplier.factory - ColorMatrix.tint(UvColor tint, {double amount = 0.5})
-
Returns a tint transform that blends colors toward
tint.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isIdentity → bool
-
Returns whether this matrix is effectively the identity transform.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
values
→ List<
double> -
The raw row-major coefficients.
no setter
Methods
-
followedBy(
ColorMatrix next) → ColorMatrix -
Returns a matrix that applies this transform before
next. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transformColor(
UvColor? color) → UvColor? -
Applies this matrix to
color. -
transformStyle(
UvStyle style, {bool foreground = true, bool background = true, bool underlineColor = true}) → UvStyle -
Applies this matrix to
style.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- identity → ColorMatrix
-
The identity color transform.
final
Static Methods
-
compose(
Iterable< ColorMatrix> matrices) → ColorMatrix -
Collapses
matricesinto a single matrix in application order.