Method: Sass::Script::Value::Color#plus

Defined in:
lib/sass/script/value/color.rb

#plus(other) ⇒ Color

The SassScript + operation. Its functionality depends on the type of its argument:

Number : Adds the number to each of the RGB color channels.

Sass::Script::Value::Color : Adds each of the RGB color channels together.

Sass::Script::Value : See Base#plus.

Parameters:

  • other (Value)

    The right-hand side of the operator

Returns:

  • (Color)

    The resulting color

Raises:



463
464
465
466
467
468
469
# File 'lib/sass/script/value/color.rb', line 463

def plus(other)
  if other.is_a?(Sass::Script::Value::Number) || other.is_a?(Sass::Script::Value::Color)
    piecewise(other, :+)
  else
    super
  end
end