From 2ac51fb597640f361765ad1856da3e93ea5f4db5 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 28 Sep 2024 15:08:08 +0200 Subject: [PATCH] Yet another color darkening function. --- profiler/src/profiler/TracyColor.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/profiler/src/profiler/TracyColor.hpp b/profiler/src/profiler/TracyColor.hpp index ec1dfe6e..61599ce9 100644 --- a/profiler/src/profiler/TracyColor.hpp +++ b/profiler/src/profiler/TracyColor.hpp @@ -36,6 +36,14 @@ static tracy_force_inline uint32_t DarkenColor( uint32_t color ) ( ( ( ( color & 0x000000FF ) ) * 2 / 3 ) ); } +static tracy_force_inline uint32_t DarkenColorHalf( uint32_t color ) +{ + return 0xFF000000 | + ( ( ( ( color & 0x00FF0000 ) >> 16 ) / 2 ) << 16 ) | + ( ( ( ( color & 0x0000FF00 ) >> 8 ) / 2 ) << 8 ) | + ( ( ( ( color & 0x000000FF ) ) / 2 ) ); +} + static tracy_force_inline uint32_t DarkenColorMore( uint32_t color ) { return 0xFF000000 |