21 this->use_standard_colors_first = use_standard_colors_first_in;
27 if (have_exceeded_colors)
31 rand() % (color_thresh + 1), rand() % (color_thresh + 1),
32 rand() % (color_thresh + 1));
37 if (!use_standard_colors_first || have_used_standard_colors)
39 this->advanceRGBCounters();
43 bool used_red = used_colors.find(
TColor::red()) != used_colors.end();
46 bool used_blue = used_colors.find(
TColor::blue()) != used_colors.end();
61 have_used_standard_colors =
true;
65 this->markColorAsUsed(curr_color);
71 return TColorf(this->getNextTColor());
78 ASSERT_(!use_standard_colors_first || have_used_standard_colors);
87 color_step_triad.B = color_step;
95 curr_color += color_step_triad;
99 if (use_standard_colors_first &&
103 this->advanceRGBCounters();
111 pair<set<TColor>::const_iterator,
bool> ret = used_colors.insert(
color);
122 color_step_triad =
TColor(0, 0, 50);
124 have_exceeded_colors =
false;
125 use_standard_colors_first =
true;
126 have_used_standard_colors =
false;
131 bool ret = used_colors.find(
TColor::red()) != used_colors.end() &&
void markColorAsUsed(mrpt::img::TColor color)
Mark the given color as used.
void advanceRGBCounters()
#define THROW_EXCEPTION(msg)
static constexpr TColor blue()
bool checkStdColorsUsed()
Check if the standard colors have already been used.
mrpt::img::TColor getNextTColor()
Get the next RGB triad in TColor form.
mrpt::img::TColorf getNextTColorf()
Get the next RGB triad in TColorf form.
#define ASSERT_(f)
Defines an assertion mechanism.
~TColorManager()
Destructor.
void reset()
Reset all class properties to their default values.
static constexpr TColor green()
static constexpr TColor red()
Predefined colors.
A RGB color - floats in the range [0,1].
TColorManager(bool use_standard_colors_first=true)
Constructor.