Skip to content

Commit

Permalink
Merge pull request #1718 from ghutchis/fix-measure-colors
Browse files Browse the repository at this point in the history
  • Loading branch information
ghutchis authored Sep 24, 2024
2 parents 7d04a44 + 07f5f46 commit 8563422
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion avogadro/qtplugins/measuretool/measuretool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,15 @@ void MeasureTool::draw(Rendering::GroupNode& node)

TextProperties overlayTProp;
overlayTProp.setFontFamily(TextProperties::Mono);
overlayTProp.setColorRgb(64, 255, 220);

Vector3ub color(64, 255, 220);
if (m_renderer) {
auto backgroundColor = m_renderer->scene().backgroundColor();
color = contrastingColor(
Vector3ub(backgroundColor[0], backgroundColor[1], backgroundColor[2]));
}

overlayTProp.setColorRgb(color[0], color[1], color[2]);
overlayTProp.setAlign(TextProperties::HLeft, TextProperties::VBottom);

auto* label = new TextLabel2D;
Expand Down

0 comments on commit 8563422

Please sign in to comment.