summaryrefslogtreecommitdiff
path: root/src/gui/theme.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-31 17:07:13 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-31 17:33:20 +0300
commit6683d42b636619e02e2bcf98923a2fdbf44bd95b (patch)
tree7c7bb1c27fd1b756a428b639f098b51cdeb08b94 /src/gui/theme.h
parentd7c67fa2b6faa3e81269244224da4b72f045d659 (diff)
downloadmanaplus-6683d42b636619e02e2bcf98923a2fdbf44bd95b.tar.gz
manaplus-6683d42b636619e02e2bcf98923a2fdbf44bd95b.tar.bz2
manaplus-6683d42b636619e02e2bcf98923a2fdbf44bd95b.tar.xz
manaplus-6683d42b636619e02e2bcf98923a2fdbf44bd95b.zip
Move functions getColor, getIdByChar from palette to theme and userpalette.
Diffstat (limited to 'src/gui/theme.h')
-rw-r--r--src/gui/theme.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gui/theme.h b/src/gui/theme.h
index edbe31a08..5a9a75bb0 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -125,6 +125,31 @@ class Theme final : public Palette,
{ return mMinimumOpacity; }
/**
+ * Gets the color associated with the type. Sets the alpha channel
+ * before returning.
+ *
+ * @param type the color type requested
+ * @param alpha alpha channel to use
+ *
+ * @return the requested color
+ */
+ inline const Color &getColor(int type,
+ const int alpha = 255) A_WARN_UNUSED
+ {
+ if (type >= static_cast<signed>(mColors.size()) || type < 0)
+ {
+ logger->log("incorrect color request type: %d from %u",
+ type, static_cast<unsigned int>(mColors.size()));
+ type = 0;
+ }
+ Color* col = &mColors[type].color;
+ col->a = alpha;
+ return *col;
+ }
+
+ int getIdByChar(const signed char c, bool &valid) const A_WARN_UNUSED;
+
+ /**
* Set the minimum opacity allowed to skins.
* Set a negative value to free the minimum allowed.
*/