Generate random hex color code

Topic Labels: Formulas
236 3
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

Hi Community!

I would like generate with a formula a random hex color code for each new record in a database. How can I do that?

Thank you for your help!


3 Replies 3

If you want a truly random system, you will need a script. Put the script in an automation that runs when the record is created.

If you are okay with a pseudo random system, it is theoretically possible to generate a hex color code from the record ID, but that would be a very long, complex formula. I think that a script would be easier.

4 - Data Explorer
4 - Data Explorer

Pseudo-random is fine. My main motivation is just to change the color / hex code  a bit within a variation of posts.

12 - Earth
12 - Earth

It's an interesting question, a translation between numeric system from base 62 to base 16
I would get last char of RECORD_ID(), 




4 - to get a range from 4 to 248
then get 2 chars:



where X



where Y is upper formula.
and then repeat two times, changing number 1 in upper formula to 2,3

the result should look quite complex. but nothing ever easy 🙂