Feature request #2116

avoid black and white from default colors

Added by Paolo Cavallini over 7 years ago. Updated over 1 year ago.

Status:Closed Start Date:
Priority:Low Due date:
Assigned to:- % Done:


Target version:Future Release - Nice to have
Platform:All Resolution:fixed/implemented
Platform version: Pull Request or Patch supplied:No
Status info:0 Tag:


When loading a vector, random colors are assigned; it seems appropriate avoiding both black and white, as white can be confused with background, and black is the default color for outline. Same for random colors in classifications


Updated by Giovanni Manghi over 5 years ago

  • Target version changed from Version 1.7.0 to Version 1.7.4

Updated by Giovanni Manghi about 5 years ago

  • Target version changed from Version 1.7.4 to Version 2.0.0

Updated by Pirmin Kalberer over 4 years ago

  • Target version changed from Version 2.0.0 to Future Release - Nice to have

Updated by Médéric RIBREUX over 1 year ago

  • Status changed from Open to Closed
  • Assigned to deleted (nobody -)
  • % Done changed from 0 to 100
  • Resolution set to fixed/implemented
  • Pull Request or Patch supplied set to No

Hello, bug triage...

after digging into the code, I've found the default color symbol affectation (on core/symbology-ng/qgssymbolv2.cpp):

s->setColor( QColor::fromHsv( qrand() % 360, 64 + qrand() % 192, 128 + qrand() % 128 ) );

The saturation can't be inferior to 64 (avoid color to be too white) and the value can't be inferior to 128 (avoiding too dark colors).

I am closing this old one !

Also available in: Atom