1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 20:33:52 +00:00

Text drawing with even more increased contrast.

This commit is contained in:
Bartosz Taudul 2022-07-03 12:50:35 +02:00
parent 21128be933
commit f8f76a3d04
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -159,6 +159,22 @@ static constexpr const ImVec4 SyntaxColorsDimmed[] = {
draw->AddText( pos, color, text );
}
[[maybe_unused]] static inline void DrawTextSuperContrast( ImDrawList* draw, const ImVec2& pos, uint32_t color, const char* text )
{
const auto scale = GetScale();
const auto s1 = round( scale );
const auto s2 = round( scale * 1.5f );
draw->AddText( pos + ImVec2( 0, s2 ), 0xAA000000, text );
draw->AddText( pos + ImVec2( 0, -s2 ), 0xAA000000, text );
draw->AddText( pos + ImVec2( s2, 0 ), 0xAA000000, text );
draw->AddText( pos + ImVec2( -s2, 0 ), 0xAA000000, text );
draw->AddText( pos + ImVec2( s1, s1 ), 0xAA000000, text );
draw->AddText( pos + ImVec2( -s1, s1 ), 0xAA000000, text );
draw->AddText( pos + ImVec2( -s1, -s1 ), 0xAA000000, text );
draw->AddText( pos + ImVec2( s1, -s1 ), 0xAA000000, text );
draw->AddText( pos, color, text );
}
[[maybe_unused]] static void SetButtonHighlightColor()
{
ImGui::PushStyleColor( ImGuiCol_Button, (ImVec4)ImColor::HSV( 0.35f, 0.6f, 0.6f ) );