#3919 Contrast colors for contour lines

This commit is contained in:
Gaute Lindkvist
2018-12-21 09:35:41 +01:00
parent 22f054c6b9
commit 9fdec77c94
3 changed files with 27 additions and 5 deletions

View File

@@ -81,13 +81,33 @@ cvf::Color3f RiaColorTools::brightContrastColor()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTools::constrastColor(cvf::Color3f backgroundColor)
cvf::Color3f RiaColorTools::darkContrastColorSofter()
{
return cvf::Color3f::fromByteColor(30, 30, 30);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTools::brightContrastColorSofter()
{
return cvf::Color3f::fromByteColor(200, 200, 200);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTools::constrastColor(cvf::Color3f backgroundColor, bool softerContrast)
{
if (isBrightnessAboveThreshold(backgroundColor))
{
if (softerContrast)
return darkContrastColorSofter();
return darkContrastColor();
}
if (softerContrast)
return brightContrastColorSofter();
return brightContrastColor();
}