SassColor.rgb constructor

SassColor.rgb(
  1. int red,
  2. int green,
  3. int blue,
  4. [num? alpha = 1]
)

Creates an RGB color.

Passing null to alpha is deprecated, and will change behavior in future versions of Dart Sass to represent a missing component instead of being equivalent to 1. Callers who want to create opaque colors should explicitly pass 1 or not pass alpha at all.

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(int red, int green, int blue, [num? alpha = 1])
    : this.rgbInternal(red, green, blue, _handleNullAlpha(alpha));