diff --git a/include/openmc/plot.h b/include/openmc/plot.h index d762cad70..48920afad 100644 --- a/include/openmc/plot.h +++ b/include/openmc/plot.h @@ -49,6 +49,10 @@ struct RGBColor { blue = v[2]; } + bool operator ==(const RGBColor& other) { + return red == other.red && green == other.green && blue == other.blue; + } + // Members uint8_t red, green, blue; }; diff --git a/src/plot.cpp b/src/plot.cpp index d53a12805..78b1c6a71 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -403,6 +403,10 @@ Plot::set_default_colors(pugi::xml_node plot_node) for (auto& c : colors_) { c = random_color(); + // make sure we don't interfere with some default colors + while (c == RED || c == WHITE) { + c = random_color(); + } } }