aboutsummaryrefslogtreecommitdiff
path: root/lib/util.h
diff options
context:
space:
mode:
authorAlexey Andreyev <aa13q@ya.ru>2019-05-15 16:36:02 +0300
committerAlexey Andreyev <aa13q@ya.ru>2019-05-23 02:12:56 +0300
commit48ffee5fa78f44bd00d76772ad79ae4eeb6c8dc4 (patch)
tree7dd9996a3e89f36a942617a740fd33c069871e1e /lib/util.h
parentd6f39dcb0de69322479f287514a8c36afcb3fe7b (diff)
downloadlibquotient-48ffee5fa78f44bd00d76772ad79ae4eeb6c8dc4.tar.gz
libquotient-48ffee5fa78f44bd00d76772ad79ae4eeb6c8dc4.zip
Move out the logic of the hue calculation to utils
Diffstat (limited to 'lib/util.h')
-rw-r--r--lib/util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/util.h b/lib/util.h
index f08c1c95..eda817a1 100644
--- a/lib/util.h
+++ b/lib/util.h
@@ -314,5 +314,13 @@ namespace QMatrixClient
* \param dir path to cache directory relative to the standard cache path
*/
QString cacheLocation(const QString& dirName);
+
+ /** Hue color component of based of the hash of the string.
+ * The implementation is based on XEP-0392:
+ * https://xmpp.org/extensions/xep-0392.html
+ * Naming and range are the same as QColor's hueF method:
+ * https://doc.qt.io/qt-5/qcolor.html#integer-vs-floating-point-precision
+ */
+ qreal stringToHueF(const QString& string);
} // namespace QMatrixClient