From 128208d35aa58eaaf0e1beddcc18fa418467ee8b Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Fri, 21 Dec 2018 10:11:01 +0100 Subject: [PATCH] Fix type in RiaColorTools contrastColor --- ApplicationCode/Application/Tools/RiaColorTools.cpp | 2 +- ApplicationCode/Application/Tools/RiaColorTools.h | 2 +- .../ModelVisualization/GridBox/RivGridBoxGenerator.cpp | 2 +- .../ModelVisualization/RivContourMapProjectionPartMgr.cpp | 4 ++-- ApplicationCode/UserInterface/RiuViewer.cpp | 2 +- .../UserInterface/RiuWellPathComponentPlotItem.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ApplicationCode/Application/Tools/RiaColorTools.cpp b/ApplicationCode/Application/Tools/RiaColorTools.cpp index 31bafbfc8a..6cea2f8b47 100644 --- a/ApplicationCode/Application/Tools/RiaColorTools.cpp +++ b/ApplicationCode/Application/Tools/RiaColorTools.cpp @@ -101,7 +101,7 @@ cvf::Color3f RiaColorTools::brightContrastColorSofter() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -cvf::Color3f RiaColorTools::constrastColor(cvf::Color3f backgroundColor, bool softerContrast) +cvf::Color3f RiaColorTools::contrastColor(cvf::Color3f backgroundColor, bool softerContrast) { if (isBrightnessAboveThreshold(backgroundColor)) { diff --git a/ApplicationCode/Application/Tools/RiaColorTools.h b/ApplicationCode/Application/Tools/RiaColorTools.h index a47338462e..c12bf500b3 100644 --- a/ApplicationCode/Application/Tools/RiaColorTools.h +++ b/ApplicationCode/Application/Tools/RiaColorTools.h @@ -38,7 +38,7 @@ public: static cvf::Color3f brightContrastColor(); static cvf::Color3f darkContrastColorSofter(); static cvf::Color3f brightContrastColorSofter(); - static cvf::Color3f constrastColor(cvf::Color3f backgroundColor, bool softerContrast = false); + static cvf::Color3f contrastColor(cvf::Color3f backgroundColor, bool softerContrast = false); static QColor toQColor(cvf::Color3f color, float alpha = 1.0f); static QColor toQColor(cvf::Color4f color); static float contrastRatio(cvf::Color3f color1, cvf::Color3f color2); diff --git a/ApplicationCode/ModelVisualization/GridBox/RivGridBoxGenerator.cpp b/ApplicationCode/ModelVisualization/GridBox/RivGridBoxGenerator.cpp index bd029f1fa1..5ce4951ba2 100644 --- a/ApplicationCode/ModelVisualization/GridBox/RivGridBoxGenerator.cpp +++ b/ApplicationCode/ModelVisualization/GridBox/RivGridBoxGenerator.cpp @@ -741,7 +741,7 @@ cvf::Vec3f RivGridBoxGenerator::cornerDirection(FaceType face1, FaceType face2) void RivGridBoxGenerator::updateFromBackgroundColor(const cvf::Color3f& backgroundColor) { m_gridColor = RiaColorTools::computeOffsetColor(backgroundColor, 0.3f); - m_gridLegendColor = RiaColorTools::constrastColor(backgroundColor); + m_gridLegendColor = RiaColorTools::contrastColor(backgroundColor); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ModelVisualization/RivContourMapProjectionPartMgr.cpp b/ApplicationCode/ModelVisualization/RivContourMapProjectionPartMgr.cpp index 9210c2cb3b..d95370049a 100644 --- a/ApplicationCode/ModelVisualization/RivContourMapProjectionPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivContourMapProjectionPartMgr.cpp @@ -62,7 +62,7 @@ void RivContourMapProjectionPartMgr::appendProjectionToModel(cvf::ModelBasicList std::vector> contourDrawables = contourDrawablesForAllLevels[i]; cvf::Color3f backgroundColor(mapper->mapToColor(tickValues[i])); - cvf::Color3f lineColor = RiaColorTools::constrastColor(backgroundColor, true); + cvf::Color3f lineColor = RiaColorTools::contrastColor(backgroundColor, true); for (cvf::ref contourDrawable : contourDrawables) { @@ -234,7 +234,7 @@ std::vector>> RivContourMapProjectionPartMgr std::vector> contourDrawables; cvf::Color3f backgroundColor(mapper->mapToColor(tickValues[i])); - cvf::Color3f textColor = RiaColorTools::constrastColor(backgroundColor); + cvf::Color3f textColor = RiaColorTools::contrastColor(backgroundColor); for (size_t j = 0; j < contourPolygons[i].size(); ++j) { diff --git a/ApplicationCode/UserInterface/RiuViewer.cpp b/ApplicationCode/UserInterface/RiuViewer.cpp index 7eba98a4b6..bebcb0e3ea 100644 --- a/ApplicationCode/UserInterface/RiuViewer.cpp +++ b/ApplicationCode/UserInterface/RiuViewer.cpp @@ -1106,7 +1106,7 @@ cvf::Color3f RiuViewer::computeContrastColor() const if (m_rimView.notNull()) { - contrastColor = RiaColorTools::constrastColor(m_rimView->backgroundColor()); + contrastColor = RiaColorTools::contrastColor(m_rimView->backgroundColor()); } return contrastColor; diff --git a/ApplicationCode/UserInterface/RiuWellPathComponentPlotItem.cpp b/ApplicationCode/UserInterface/RiuWellPathComponentPlotItem.cpp index 9318879725..8ea0691020 100644 --- a/ApplicationCode/UserInterface/RiuWellPathComponentPlotItem.cpp +++ b/ApplicationCode/UserInterface/RiuWellPathComponentPlotItem.cpp @@ -306,7 +306,7 @@ QwtPlotItem* RiuWellPathComponentPlotItem::createMarker(double posX, double dept QColor textColor = RiaColorTools::toQColor(baseColor.toColor3f(), 1.0); if (contrastTextColor) { - textColor = RiaColorTools::toQColor(RiaColorTools::constrastColor(baseColor.toColor3f())); + textColor = RiaColorTools::toQColor(RiaColorTools::contrastColor(baseColor.toColor3f())); } QwtPlotMarker* marker = new QwtPlotMarker(label); RiuQwtSymbol* symbol = new RiuQwtSymbol(symbolType, "", RiuQwtSymbol::LabelRightOfSymbol);