Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Server: Fix build (no qtgui, thus no QColor)
  • Loading branch information
danij-deng committed Nov 17, 2013
1 parent f2b01e4 commit 9a21921
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doomsday/client/include/resource/colorpalette.h
Expand Up @@ -25,7 +25,9 @@
#include <de/Id>
#include <de/Observers>
#include <de/Vector>
#ifdef __CLIENT__
#include <QColor>
#endif
#include <QVector>

/**
Expand Down Expand Up @@ -118,13 +120,15 @@ class ColorPalette
*/
de::Vector3f colorf(int colorIndex) const;

#ifdef __CLIENT__
/**
* Same as @ref color() except the color is returned as a QColor instance.
*/
inline QColor colorq(int colorIndex, int alpha = 255) const {
de::Vector3ub rgb = color(colorIndex);
return QColor(rgb.x, rgb.y, rgb.z, alpha);
}
#endif

/**
* Given an R8G8B8 color triplet return the closet matching color index.
Expand Down

0 comments on commit 9a21921

Please sign in to comment.