Commit 664c020b by Aaron Leung

Implemented "alpha" and "opacity".

parent b0693709
......@@ -41,6 +41,9 @@ namespace Sass {
register_function(mix_3_descriptor, mix_3);
// HSL Functions
register_function(invert_descriptor, invert);
// Opacity Functions
register_function(alpha_descriptor, alpha);
register_function(opacity_descriptor, alpha);
// String Functions
register_function(unquote_descriptor, unquote);
register_function(quote_descriptor, quote);
......
......@@ -101,6 +101,16 @@ namespace Sass {
255 - orig[2].content.numeric_value,
orig[3].content.numeric_value);
}
// Opacity Functions ///////////////////////////////////////////////////
Function_Descriptor alpha_descriptor =
{ "alpha", "$color", 0 };
Function_Descriptor opacity_descriptor =
{ "opacity", "$color", 0 };
Node alpha(const vector<Token>& parameters, map<Token, Node>& bindings) {
return bindings[parameters[0]][3];
}
// String Functions ////////////////////////////////////////////////////
......
......@@ -72,6 +72,11 @@ namespace Sass {
extern Function_Descriptor invert_descriptor;
Node invert(const vector<Token>& parameters, map<Token, Node>& bindings);
// Opacity Functions ///////////////////////////////////////////////////
extern Function_Descriptor alpha_descriptor;
extern Function_Descriptor opacity_descriptor;
Node alpha(const vector<Token>& parameters, map<Token, Node>& bindings);
// String Functions ////////////////////////////////////////////////////
extern Function_Descriptor unquote_descriptor;
Node unquote(const vector<Token>& parameters, map<Token, Node>& bindings);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment