@Jason_Coon @marmil Thank you both! The thing is with
CHSV color = CHSV(h, s, v);
I need to specify h and s also, but I can’t know what they are.
The colours are set independently for all 144 LEDs by a function that EVERY_N_MINUTES fetches a new colour from a palette, which works very well on its own.
The other function EVERY_N_MILLISECONDS, similar to the @Mark_Kriegsman example, randomly darkens/brightens LEDs with a state flag, and that also works very well on its own.
In other words, the second function needs, apart from the random LED selection stuff, to simply manipulate just the v component of certain LEDs, if you see what I mean. So in the end I have in the loop
ultraslowPalette(); - goes through a palette over an hour
fairlyFastTwinkle(); - darkens/brightens random LEDs quickly
If I were to use
leds[i] = ColorFromPalette (palette, index, brightness);
also in the fairlyFastTwinkle() function, I would interfere with the other function that with a different timing already fetches colours from the palette.