lerp method
Linearly interpolates between this color and other.
Parameter t should be 0.0-1.0 (0.0 = this color, 1.0 = other color).
Implementation
@override
RayOklab lerp(Ray other, double t) {
if (t < 0.0 || t > 1.0) {
throw ArgumentError.value(
t, 't', 'Interpolation factor must be between 0.0 and 1.0');
}
if (t == 0.0) return this;
if (t == 1.0) return other.toOklab();
final otherOklab = other.toOklab();
return RayOklab._(
l: _l + (otherOklab._l - _l) * t,
a: _a + (otherOklab._a - _a) * t,
b: _b + (otherOklab._b - _b) * t,
opacity: opacity + (otherOklab.opacity - opacity) * t,
);
}