MCPcopy
hub / github.com/FlowiseAI/Flowise / generateRandomGradient

Function generateRandomGradient

packages/ui/src/utils/genericHelper.js:801–818  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

799}
800
801export const generateRandomGradient = () => {
802 function randomColor() {
803 var color = 'rgb('
804 for (var i = 0; i < 3; i++) {
805 var random = Math.floor(Math.random() * 256)
806 color += random
807 if (i < 2) {
808 color += ','
809 }
810 }
811 color += ')'
812 return color
813 }
814
815 var gradient = 'linear-gradient(' + randomColor() + ', ' + randomColor() + ')'
816
817 return gradient
818}
819
820export const getInputVariables = (input) => {
821 // This regex will match single curly-braced substrings

Callers 2

addNewToolFunction · 0.90
addNewServerFunction · 0.90

Calls 1

randomColorFunction · 0.85

Tested by

no test coverage detected