diff --git a/server/TracyColor.hpp b/server/TracyColor.hpp index 5a8ae882..98712679 100644 --- a/server/TracyColor.hpp +++ b/server/TracyColor.hpp @@ -28,6 +28,14 @@ static tracy_force_inline uint32_t DarkenColor( uint32_t color ) ( ( ( ( color & 0x000000FF ) ) * 2 / 3 ) ); } +static tracy_force_inline uint32_t DarkenColorMore( uint32_t color ) +{ + return 0xFF000000 | + ( ( ( ( color & 0x00FF0000 ) >> 16 ) * 1 / 4 ) << 16 ) | + ( ( ( ( color & 0x0000FF00 ) >> 8 ) * 1 / 4 ) << 8 ) | + ( ( ( ( color & 0x000000FF ) ) * 1 / 4 ) ); +} + } #endif diff --git a/server/TracyView_Plots.cpp b/server/TracyView_Plots.cpp index 99e944c6..5c9f4730 100644 --- a/server/TracyView_Plots.cpp +++ b/server/TracyView_Plots.cpp @@ -174,6 +174,11 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl auto& vec = v->data; vec.ensure_sorted(); + const auto color = GetPlotColor( v ); + const auto bg = 0x22000000 | ( DarkenColorMore( color ) & 0xFFFFFF ); + + draw->AddRectFilled( ImVec2( 0, yPos ), ImVec2( w, yPos + PlotHeight ), bg ); + if( v->type == PlotType::Memory ) { auto& mem = m_worker.GetMemoryNamed( v->name ); @@ -273,7 +278,6 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl } const auto revrange = 1.0 / ( max - min ); - const auto color = GetPlotColor( v ); if( it == vec.begin() ) {