Instead of generating random R, G, B values, perhaps you could use a different colour space- HSV for example- and generate random hues? Keeping the saturation and value constant.
You can use the
hsv_to_rgb method in
colorsys to convert 3 floating point values- between 0.0 and 1.0- representing Hue, Saturation and Value into RGB:
hue = randint(0, 359) # (In degrees)
sat = 1.0
val = 1.0
r, g, b = [int(c * 255) for c in colorsys.hsv_to_rgb(hue/359.0, sat, val)]
int(c * 255) converts the 0.0-1.0 float values returned by hsv_to_rgb into the 0-255 range understood by Unicorn HAT.
If you want variable saturation and brightness you could also randomise those between known good values.
HSV has other benefits, too, by adjusting your random range you can pick portions of the hue wheel that contain complementary colours to randomise. For example you might just want shades of pink and blue, ie:
Googling ‘hue wheel’ will give you some guidance about what colours appear where, for example;