Feature request #2116

avoid black and white from default colors

Added by Paolo Cavallini about 15 years ago. Updated about 9 years ago.

Status:Closed
Priority:Low
Assignee:-
Category:Symbology
Pull Request or Patch supplied:No Resolution:fixed/implemented
Easy fix?:No Copied to github as #:12176

Description

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

History

#1 Updated by Giovanni Manghi almost 13 years ago

  • Target version changed from Version 1.7.0 to Version 1.7.4

#2 Updated by Giovanni Manghi over 12 years ago

  • Target version changed from Version 1.7.4 to Version 2.0.0

#3 Updated by Pirmin Kalberer about 12 years ago

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

#4 Updated by Médéric RIBREUX about 9 years ago

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

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 PDF