Hi Community!
I’m a make.com newbie. I would like to generate with set-variable a random hex color code that I can use later in an automation with placid.app to generate an image in that color.
What’s the best formula to generate the random hex color code?
Thanks for your help!
Stefan
Hi Stefan,
I don’t think there is a direct formula to do that, but maybe something like this will work:
blueprint (6).json (7.1 KB)
2 Likes
Welcome to the Make community!
Similarly to Random Alphanumeric Coupon Code Generator - #5 by samliew, you can generate a random hex colour code using

Output

You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.
-
Copy the code below by clicking the copy button when you mouseover the top-right of the code block

-
Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV to paste in the canvas.
-
Click on each imported module and save it. You may need to remap some variables.
Modules JSON Export
{
"subflows": [
{
"flow": [
{
"id": 1,
"module": "util:SetVariable2",
"version": 1,
"parameters": {},
"mapper": {
"name": "colour",
"scope": "roundtrip",
"value": "{{substring(join(shuffle(shuffle(shuffle(split(\"ABCDEF0123456789\"; emptystring)))); emptystring); 0; 6)}}"
},
"metadata": {
"designer": {
"x": -25,
"y": 168,
"name": "Generate random colour"
},
"restore": {
"expect": {
"scope": {
"label": "One cycle"
}
}
},
"expect": [
{
"name": "name",
"type": "text",
"label": "Variable name",
"required": true
},
{
"name": "scope",
"type": "select",
"label": "Variable lifetime",
"required": true,
"validate": {
"enum": [
"roundtrip",
"execution"
]
}
},
{
"name": "value",
"type": "any",
"label": "Variable value"
}
],
"interface": [
{
"name": "colour",
"label": "colour",
"type": "any"
}
]
}
}
]
}
],
"metadata": {
"version": 1
}
}
4 Likes
Thank you, this is exactly what I was looking for!
2 Likes
No problem, glad I could help!
1. If you have a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.
2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.
This marks the topic as solved, so that:
others can save time when catching up with the latest activity here, and
- allows others to quickly jump to the solution if they come across the same problem
To do this, simply click the checkbox at the bottom of the post that answers your question:

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!
2 Likes