diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/Matrix.cpp | 9 |
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; } |