aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-17 13:42:31 +0200
committerdec05eba <dec05eba@protonmail.com>2020-10-17 14:56:41 +0200
commit4a7b86829025664f6eeef6fcb5fc0894733f2ad6 (patch)
treeefd29796ec64b31609640dfea633e3ada982ee1d /src/plugins
parent9bf163d51a252fb5a611e88c2e0b4123a98169e1 (diff)
Matrix: make displayname more bright, add circle mask shader for avatar and room thumbnails
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Matrix.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 1cb2aa5..ea5f86c 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -269,10 +269,11 @@ namespace QuickMedia {
for(unsigned char c : user_id) {
color = (color * 16777619) ^ c;
}
- sf::Color result = (sf::Color)color;
- result.r = 64 + std::max(0, (int)result.r - 64);
- result.g = 64 + std::max(0, (int)result.g - 64);
- result.b = 64 + std::max(0, (int)result.b - 64);
+ sf::Uint8 *col = (sf::Uint8*)&color;
+ sf::Color result(col[0], col[1], col[2]);
+ result.r = std::min(255, 80 + (int)result.r);
+ result.g = std::min(255, 80 + (int)result.g);
+ result.b = std::min(255, 80 + (int)result.b);
result.a = 255;
return result;
}