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 color as 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

batchTransformRgba(covariant List<int> rIn, covariant List<int> gIn, covariant List<int> bIn, covariant List<int> aIn, covariant List<int> rOut, covariant List<int> gOut, covariant List<int> bOut, covariant List<int> aOut, int count) → void
Batch-transform RGBA values using Float32x4 SIMD.
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 matrices into a single matrix in application order.