Overlay – Random Color

It is not for the first time that Random Color Overlay generates very close color tint just for a two objects, that does this overlay feature useless (…if the main purpose is to visually differentiates elements).

I don’t have a skills for something like this, so I have to ask – Would it be hard to improve algorithm to generate colors based on complementary colors or any other method to guarantee more pronounced color variations?

Thank you make blender even more awesome :slight_smile:

If I remember correctly, the random color is selected by hashing the object name. This gives you a way to re-roll the color via renaming, but the evenness of the distribution is definitely a problem. Overall, it feels like someone skimmed a guide on building HCL color palettes for data visualization, missed the chapter on intentional lightness variation to aid accessibility, and then tied it to a seed generator that exacerbates the palette issues.

Thank you for reply :slight_smile: Hmm … colour from naming … that is interesting. Thanks for the spot. The issue is - you don’t want to rename object just because of different colour (since name is used to keep structure organised).

To admit … I know it is not possible to generate complementary colours in all scenarios. I can imagine something for static object composition (to generate from distance), but for animated objects there doesn’t exist a solution for sure.

My expectation here was a system where colour is given from order of adding object to a scene - Like first 6 objects starts from complementary colours and others continues as derivations or so …

To get similar result to what is happening to Circle objects on this screen … sure colors here comes from naming Circle, Circle.001, Circle.002, … but as you said it is just a luck of characters (letters) combination for such result.

I’m not sure if my “proposal” is not a even worse option, but if the only one way to differentiate colours is to try another name … that doesn’t sound good. Like here for simple scene Cube and Icosphere use “identical” color any time they are added.

I’m not looking for some advanced system where user can adjust color, those are just “random” colors, but I would expect a bit better behaviour for a scene with just a few objects.

To be honest, it’s hard to beat obj.color = (random.random(), random.random(), random.random(), 1.0) with a bit of manual tweaking on top, without getting into two-tone or fill pattern setups. Sequentially selected complimentary colors only work when sequentially created objects are spatially adjacent, and dialing in the min/max hue step is always a pile of compromises.

I was thinking about this, maybe the random generator can take into account position of the object, so it makes sure no adjacent object has same color

but it won’t be updated every frame, only when requested

something like “Regenerate Random Color” button

just an idea