add custom tool

This commit is contained in:
Henry
2023-06-21 18:31:53 +01:00
parent 8c880199cd
commit 70da39629c
28 changed files with 1346 additions and 43 deletions
+20 -1
View File
@@ -39,7 +39,7 @@ export const initNode = (nodeData, newNodeId) => {
const incoming = nodeData.inputs ? nodeData.inputs.length : 0
const outgoing = 1
const whitelistTypes = ['options', 'string', 'number', 'boolean', 'password', 'json', 'code', 'date', 'file', 'folder']
const whitelistTypes = ['asyncOptions', 'options', 'string', 'number', 'boolean', 'password', 'json', 'code', 'date', 'file', 'folder']
for (let i = 0; i < incoming; i += 1) {
const newInput = {
@@ -334,3 +334,22 @@ export const throttle = (func, limit) => {
}
}
}
export const generateRandomGradient = () => {
function randomColor() {
var color = 'rgb('
for (var i = 0; i < 3; i++) {
var random = Math.floor(Math.random() * 256)
color += random
if (i < 2) {
color += ','
}
}
color += ')'
return color
}
var gradient = 'linear-gradient(' + randomColor() + ', ' + randomColor() + ')'
return gradient
}