Gui: Use a perceptually uniform color map for Std_RandomColor
Using a restricted set of colrs with uniform lightless improves the appearance of assemblies with randomly-colored parts.
This commit is contained in:
committed by
Kacper Donat
parent
aec251427e
commit
d377d43de5
@@ -29,6 +29,7 @@
|
||||
#include <App/GroupExtension.h>
|
||||
#include <App/Part.h>
|
||||
#include "Application.h"
|
||||
#include "cet_lut.hpp"
|
||||
#include "CommandT.h"
|
||||
#include "DockWindowManager.h"
|
||||
#include "Document.h"
|
||||
@@ -90,10 +91,10 @@ void StdCmdRandomColor::activated(int iMsg)
|
||||
|
||||
auto setRandomColor = [](ViewProvider* view) {
|
||||
// NOLINTBEGIN
|
||||
auto fMax = (float)RAND_MAX;
|
||||
auto fRed = (float)rand()/fMax;
|
||||
auto fGrn = (float)rand()/fMax;
|
||||
auto fBlu = (float)rand()/fMax;
|
||||
int colIndex = rand() % (CET::R1.size() / 3) * 3;
|
||||
float fRed = CET::R1[colIndex] / 255.0F;
|
||||
float fGrn = CET::R1[colIndex + 1] / 255.0F;
|
||||
float fBlu = CET::R1[colIndex + 2] / 255.0F;
|
||||
// NOLINTEND
|
||||
auto objColor = Base::Color(fRed, fGrn, fBlu);
|
||||
|
||||
|
||||
107
src/Gui/cet_lut.hpp
Normal file
107
src/Gui/cet_lut.hpp
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user