Method: Sass::Script::Functions#transparentize

Defined in:
lib/sass/script/functions.rb

#transparentize($color, $amount) ⇒ Sass::Script::Value::Color Also known as: fade_out

Makes a color more transparent. Takes a color and a number between 0 and 1, and returns a color with the opacity decreased by that amount.

Examples:

transparentize(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.4)
transparentize(rgba(0, 0, 0, 0.8), 0.2) => rgba(0, 0, 0, 0.6)

Raises:

  • (ArgumentError)

    if $amount is out of bounds, or either parameter is the wrong type

See Also:



1035
1036
1037
# File 'lib/sass/script/functions.rb', line 1035

def transparentize(color, amount)
  _adjust(color, amount, :alpha, 0..1, :-)
end