Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-07-24 02:29:06 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-07-24 02:29:52 +0300
commit755df94f45849bab8fee4e78ba34963b0647ed8b (patch)
treefc22bab9ad5057a97de0f3584910f90f236ceb02 /server/TracyColor.hpp
parent27a98a3cc249983bffb22facde243973f04b50dc (diff)
Move DarkenColor() to a proper source file.
Diffstat (limited to 'server/TracyColor.hpp')
-rw-r--r--server/TracyColor.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/TracyColor.hpp b/server/TracyColor.hpp
index 3fcc7468..5a8ae882 100644
--- a/server/TracyColor.hpp
+++ b/server/TracyColor.hpp
@@ -20,6 +20,14 @@ static tracy_force_inline uint32_t HighlightColor( uint32_t color )
( std::min<int>( 0xFF, ( ( ( color & 0x000000FF ) ) + V ) ) );
}
+static tracy_force_inline uint32_t DarkenColor( uint32_t color )
+{
+ return 0xFF000000 |
+ ( ( ( ( color & 0x00FF0000 ) >> 16 ) * 2 / 3 ) << 16 ) |
+ ( ( ( ( color & 0x0000FF00 ) >> 8 ) * 2 / 3 ) << 8 ) |
+ ( ( ( ( color & 0x000000FF ) ) * 2 / 3 ) );
+}
+
}
#endif