Added a new function - extract for extracting padding values from a variable

This commit is contained in:
ScottRippey
2013-01-08 15:59:39 -08:00
committed by Luke Page
parent d5bb30b4db
commit 454a761e9c
3 changed files with 13 additions and 0 deletions

View File

@@ -346,6 +346,11 @@ tree.functions = {
shade: function(color, amount) {
return this.mix(this.rgb(0, 0, 0), color, amount);
},
extract: function(index, values) {
index = index.value - 1; // (1-based index)
return values.value[index];
},
"data-uri": function(mimetype, path) {
if (typeof window !== 'undefined') {

View File

@@ -108,3 +108,6 @@
average: #7b007b;
negation: #d73131;
}
#extract {
result: 3 2 1 C B A;
}

View File

@@ -119,3 +119,8 @@
average: average(#f60000, #0000f6);
negation: negation(#f60000, #313131);
}
#extract {
@anon: A B C 1 2 3;
result: extract(6, @anon) extract(5, @anon) extract(4, @anon) extract(3, @anon) extract(2, @anon) extract(1, @anon);
}