#1392 Improve Dark 3D-View background support

This commit is contained in:
Rebecca Cox
2017-11-07 15:08:28 +01:00
parent a920f16def
commit f3b7f0abd6
6 changed files with 114 additions and 9 deletions

View File

@@ -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;