Generate random hex color code

Welcome to the Make community!

Similarly to Random Alphanumeric Coupon Code Generator - #5 by samliew, you can generate a random hex colour code using

Screenshot_2024-03-30_210320

Output

Screenshot_2024-03-30_210335

You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.

  1. Copy the code below by clicking the copy button when you mouseover the top-right of the code block
    Screenshot_2024-01-17_200117

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV to paste in the canvas.

  3. 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