Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
58 lines (58 sloc) 1.43 KB
[
#functions-list
{
name: "list_add",
args: "list_one, list_two",
formula: "zip(list_one, list_two, a+b)",
},
{
name: "list_subtract",
args: "list_one, list_two",
formula: "zip(list_one, list_two, a-b)",
},
{
name: "list_multiply",
args: "list_one, list_two",
formula: "zip(list_one, list_two, a*b)",
},
{
name: "list_divide",
args: "list_one, list_two",
formula: "zip(list_one, list_two, a/b)",
},
{
name: "list_single_add",
args: "list_one, by",
formula: "map(list_one, value + by)",
},
{
name: "list_single_subtract",
args: "list_one, by",
formula: "map(list_one, value - by)",
},
{
name: "list_single_multiply",
args: "list_one, by",
formula: "map(list_one, value * by)",
},
{
name: "list_single_divide",
args: "list_one, by",
formula: "map(list_one, value / by)",
},
{
name: "list_tween",
args: "list_one, list_two, percent_raw",
formula: "map(range(size(list_one)), 'index', list_one[index]*(percent) + list_two[index]*(1.0-percent)) where percent = constrain(0, percent_raw, 1)",
},
{
name: "tween", //1,0,1 -> 1, 0,1,0 -> 0, 0,1,0.5 -> 0.5, 1,0,0 -> 0, 0,1,0 -> 1
args: "list_one, list_two, percent_raw",
formula: "(list_one*(percent) + list_two*(1.0-percent)) where percent = constrain(0, percent_raw, 1)",
},
{
name: "flatten",
args: "items",
formula: "if(items.size = 0, [], if(is_list(items[0]), flatten(items[0]), [items[0]]) + flatten(items[1:size(items)]))",
},
]
Something went wrong with that request. Please try again.