changeRgb method

  1. @Deprecated('Use changeChannels() instead.')
SassColor changeRgb({
  1. int? red,
  2. int? green,
  3. int? blue,
  4. num? alpha,
})

Changes one or more of this color's RGB channels and returns the result.

Implementation

@Deprecated('Use changeChannels() instead.')
SassColor changeRgb({int? red, int? green, int? blue, num? alpha}) {
  if (!isLegacy) {
    throw SassScriptException(
        "color.changeRgb() is only supported for legacy colors. Please use "
        "color.changeChannels() instead with an explicit \$space argument.");
  }

  return SassColor.rgb(
      red?.toDouble() ?? channel('red'),
      green?.toDouble() ?? channel('green'),
      blue?.toDouble() ?? channel('blue'),
      alpha?.toDouble() ?? this.alpha);
}