mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1392 Improve Dark 3D-View background support
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaBaseDefs.h"
|
||||
#include "RiaColorTools.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimProject.h"
|
||||
@@ -30,6 +31,7 @@
|
||||
#include "RimViewLinker.h"
|
||||
|
||||
#include "RivGridBoxGenerator.h"
|
||||
#include "RivTernarySaturationOverlayItem.h"
|
||||
|
||||
#include "RiuCadNavigation.h"
|
||||
#include "RiuGeoQuestNavigation.h"
|
||||
@@ -869,6 +871,12 @@ void RiuViewer::updateLegendTextAndTickMarkColor(cvf::OverlayItem* legend)
|
||||
categoryLegend->setColor(contrastColor);
|
||||
categoryLegend->setLineColor(contrastColor);
|
||||
}
|
||||
|
||||
RivTernarySaturationOverlayItem* ternaryItem = dynamic_cast<RivTernarySaturationOverlayItem*>(legend);
|
||||
if (ternaryItem)
|
||||
{
|
||||
ternaryItem->setAxisLabelsColor(contrastColor);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -899,15 +907,11 @@ void RiuViewer::updateAxisCrossTextColor()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RiuViewer::computeContrastColor() const
|
||||
{
|
||||
cvf::Color3f contrastColor = cvf::Color3f::WHITE;
|
||||
cvf::Color3f contrastColor = RiaColorTools::brightContrastColor();
|
||||
|
||||
if (m_rimView.notNull())
|
||||
{
|
||||
cvf::Color3f backgroundColor = m_rimView->backgroundColor;
|
||||
if (backgroundColor.r() + backgroundColor.g() + backgroundColor.b() > 1.5f)
|
||||
{
|
||||
contrastColor = cvf::Color3f::BLACK;
|
||||
}
|
||||
contrastColor = RiaColorTools::constrastColor(m_rimView->backgroundColor);
|
||||
}
|
||||
|
||||
return contrastColor;
|
||||
|
||||
Reference in New Issue
Block a user