Saturate colors some more and use color selection from base class

The original colors were hard to discern from the background on certain
devices.

Change-Id: I276f2cd76e0a1be40040bf5a0557a288d10d37d9
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Ulf Hermann
2014-02-26 17:44:58 +01:00
parent 1b60bc8d3d
commit 03c3241306
3 changed files with 5 additions and 4 deletions

View File

@@ -90,10 +90,9 @@ QColor PixmapCacheModel::getColor(int index) const
{ {
Q_D(const PixmapCacheModel); Q_D(const PixmapCacheModel);
if (d->range(index).pixmapEventType == PixmapCacheCountChanged) if (d->range(index).pixmapEventType == PixmapCacheCountChanged)
return QColor::fromHsl(240, 76, 166); return getColorByHue(PixmapCacheCountHue);
int ndx = getEventId(index); return getEventColor(index);
return QColor::fromHsl((ndx*25)%360, 76, 166);
} }
float PixmapCacheModel::getHeight(int index) const float PixmapCacheModel::getHeight(int index) const

View File

@@ -71,6 +71,8 @@ public:
void clear(); void clear();
private: private:
static const int PixmapCacheCountHue = 240;
class PixmapCacheModelPrivate; class PixmapCacheModelPrivate;
Q_DECLARE_PRIVATE(PixmapCacheModel) Q_DECLARE_PRIVATE(PixmapCacheModel)
}; };

View File

@@ -103,7 +103,7 @@ QColor SceneGraphTimelineModel::getColor(int index) const
double fpsFraction = 1 / (eventDuration * 60.0); double fpsFraction = 1 / (eventDuration * 60.0);
if (fpsFraction > 1.0) if (fpsFraction > 1.0)
fpsFraction = 1.0; fpsFraction = 1.0;
return QColor::fromHsl((fpsFraction*96)+10, 76, 166); return getFractionColor(fpsFraction);
} }
QString labelForSGType(int t) QString labelForSGType(int t)