diff --git a/ApplicationCode/Application/Tools/RiaColorTables.cpp b/ApplicationCode/Application/Tools/RiaColorTables.cpp index b69e279bc1..91d2beb880 100644 --- a/ApplicationCode/Application/Tools/RiaColorTables.cpp +++ b/ApplicationCode/Application/Tools/RiaColorTables.cpp @@ -190,6 +190,36 @@ const caf::ColorTable& RiaColorTables::categoryPaletteColors() return colorTable; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const caf::ColorTable& RiaColorTables::tensorWhiteGrayBlackPaletteColors() +{ + static std::vector colors{ + cvf::Color3ub::WHITE, + cvf::Color3ub::GRAY, + cvf::Color3ub::BLACK, + }; + + static caf::ColorTable colorTable = caf::ColorTable(colors); + return colorTable; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const caf::ColorTable& RiaColorTables::tensorMagentaBrownBlackPaletteColors() +{ + static std::vector colors{ + cvf::Color3ub::DARK_MAGENTA, + cvf::Color3ub::BROWN, + cvf::Color3ub::BLACK, + }; + + static caf::ColorTable colorTable = caf::ColorTable(colors); + return colorTable; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Application/Tools/RiaColorTables.h b/ApplicationCode/Application/Tools/RiaColorTables.h index 6b35226b57..20c561556f 100644 --- a/ApplicationCode/Application/Tools/RiaColorTables.h +++ b/ApplicationCode/Application/Tools/RiaColorTables.h @@ -37,6 +37,8 @@ public: static const caf::ColorTable& blueWhiteRedPaletteColors(); static const caf::ColorTable& redWhiteBluePaletteColors(); static const caf::ColorTable& categoryPaletteColors(); + static const caf::ColorTable& tensorWhiteGrayBlackPaletteColors(); + static const caf::ColorTable& tensorMagentaBrownBlackPaletteColors(); static const caf::ColorTable& angularPaletteColors(); static const caf::ColorTable& stimPlanPaletteColors(); static const caf::ColorTable& faultsPaletteColors(); diff --git a/ApplicationCode/ModelVisualization/RivTensorResultPartMgr.cpp b/ApplicationCode/ModelVisualization/RivTensorResultPartMgr.cpp index c1864b57e8..d2f8d96cb3 100644 --- a/ApplicationCode/ModelVisualization/RivTensorResultPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivTensorResultPartMgr.cpp @@ -18,6 +18,8 @@ #include "RivTensorResultPartMgr.h" +#include "RiaColorTables.h" + #include "RimGeoMechCase.h" #include "RimGeoMechView.h" #include "RimLegendConfig.h" @@ -382,15 +384,11 @@ void RivTensorResultPartMgr::createOneColorPerPrincipalScalarMapper(const RimTen arrowColors.resize(3); if (colorSet == RimTensorResults::MAGENTA_BROWN_BLACK) { - arrowColors[0] = cvf::Color3::MAGENTA; - arrowColors[1] = cvf::Color3::BROWN; - arrowColors[2] = cvf::Color3::BLACK; + arrowColors = RiaColorTables::tensorMagentaBrownBlackPaletteColors().color3ubArray(); } else if (colorSet == RimTensorResults::WHITE_GRAY_BLACK) { - arrowColors[0] = cvf::Color3::WHITE; - arrowColors[1] = cvf::Color3::GRAY; - arrowColors[2] = cvf::Color3::BLACK; + arrowColors = RiaColorTables::tensorWhiteGrayBlackPaletteColors().color3ubArray(); } scalarMapper->setColors(arrowColors);