Add red(), green(), and blue().

This commit is contained in:
Natalie Weizenbaum 2016-09-21 08:58:02 -07:00 committed by Natalie Weizenbaum
parent 048d7cff33
commit dbd55e16d8

View File

@ -56,6 +56,23 @@ void defineCoreFunctions(Environment environment) {
} }
])); ]));
environment.setFunction(new BuiltInCallable(
"red",
new ArgumentDeclaration([new Argument("color")]),
(arguments) => new SassNumber(arguments.first.assertColor("color").red)));
environment.setFunction(new BuiltInCallable(
"green",
new ArgumentDeclaration([new Argument("color")]),
(arguments) =>
new SassNumber(arguments.first.assertColor("color").green)));
environment.setFunction(new BuiltInCallable(
"blue",
new ArgumentDeclaration([new Argument("color")]),
(arguments) =>
new SassNumber(arguments.first.assertColor("color").blue)));
environment.setFunction(new BuiltInCallable( environment.setFunction(new BuiltInCallable(
"mix", "mix",
new ArgumentDeclaration([ new ArgumentDeclaration([