Method: Sass::Script::Functions#opacify

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

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

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

Examples:

opacify(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.6)
opacify(rgba(0, 0, 17, 0.8), 0.2) => #001

Parameters:

Returns:

Raises:

  • (ArgumentError)

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

See Also:



1013
1014
1015
# File 'lib/sass/script/functions.rb', line 1013

def opacify(color, amount)
  _adjust(color, amount, :alpha, 0..1, :+)
end