Sass alpha() Function

Last Updated:

Sass alpha() Function

The alpha() function returns the alpha (opacity) channel of a given color as a number between 0 and 1. You can also use opacity($color) function.

Note: You can also use opacity($color) function.

Example

SASS TO CSS CONVERTER
//Check your console @debug alpha(#e1d7d2); // 1 @debug opacity(rgba(210, 225, 221, 0.5)); // 0.5 @debug alpha(rgba(210, 225, 221, 0.5)); // 0.5

Syntax

alpha($color); // or opacity($color)

Parameter Value

ValueTypeExplanation
$color Required Specifies a color.

Return Value

ValueExplanation
Number Returns the alpha channel of $color as a number between 0 and 1.

Share this Page

Meet the Author