I generate a random color this way:
var random = new Random(); var color = String.Format("#{0:X6}", random.Next(0x1000000));
How can I exclude colors brighter than a certain value?
An quite simple way to get rid of the "upper half" of brightes colors is to mask the result via
random.Next(0x1000000) & 0x7F7F7F