Skip to content
Snippets Groups Projects
Commit 778dc2ba authored by Matthias Puchner's avatar Matthias Puchner
Browse files

mv method to the one single place where used

parent ee591f66
No related branches found
No related tags found
1 merge request!490More refactoring of material handling
......@@ -16,12 +16,3 @@
#include <deque>
#include <random>
QColor GUI::MaterialUtil::randomMaterialColor()
{
static std::random_device r;
std::default_random_engine re(r());
std::uniform_int_distribution<int> ru(0, 255);
return QColor(ru(re), ru(re), ru(re));
}
......@@ -19,8 +19,6 @@
namespace GUI::MaterialUtil {
QColor randomMaterialColor();
} // namespace GUI::MaterialUtil
#endif // BORNAGAIN_GUI_MODEL_MATERIAL_MATERIALITEMUTILS_H
......@@ -17,6 +17,7 @@
#include "GUI/Model/Material/MaterialItemUtils.h"
#include "GUI/Model/Material/MaterialModelStore.h"
#include <QUuid>
#include <random>
namespace {
......@@ -30,7 +31,13 @@ QColor suggestMaterialColor(const QString& name)
return QColor(Qt::green);
if (name.contains("Particle"))
return QColor(146, 198, 255);
return GUI::MaterialUtil::randomMaterialColor();
// return a random color
static std::random_device r;
std::default_random_engine re(r());
std::uniform_int_distribution<int> ru(0, 255);
return QColor(ru(re), ru(re), ru(re));
}
} // namespace
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment