Sass invert() Function

Last Updated:

Sass invert() Function

The invert() function returns the inverse or negative of a given color.

Example

SASS TO CSS CONVERTER
.foo{ color: invert(white); color: invert(#b37399); color: invert(#550e0c, 20%); }

Syntax

invert($color, $weight)

Parameter Value

ValueTypeExplanation
$color Required Specifies a color.
$weight Optional The $weight must be a number between 0% and 100% (both are inclusive).
  • A higher weight means the result will be closer to the negative.
  • A lower weight means it will be closer to $color.
  • 50% will always produce #808080.

Return Value

ValueExplanation
color Returns the negative or inverse of $color

Share this Page

Meet the Author