SassColor.rgb constructor Null safety

SassColor.rgb(
  1. int? _red,
  2. int? _green,
  3. int? _blue,
  4. [num? alpha,
  5. FileSpan? originalSpan]
)

Creates an RGB color.

Throws a RangeError if red, green, and blue aren't between 0 and 255, or if alpha isn't between 0 and 1.

Implementation

SassColor.rgb(this._red, this._green, this._blue,
    [num? alpha, this.originalSpan])
    : _alpha = alpha == null ? 1 : fuzzyAssertRange(alpha, 0, 1, "alpha") {
  RangeError.checkValueInInterval(red, 0, 255, "red");
  RangeError.checkValueInInterval(green, 0, 255, "green");
  RangeError.checkValueInInterval(blue, 0, 255, "blue");
}