From 552ab71a5007b2098b1a05a052c8bd3f831b2951 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 10 Jun 2019 19:55:56 -0500 Subject: [PATCH] Making sure default colors aren't being used. --- include/openmc/plot.h | 4 ++++ src/plot.cpp | 4 ++++ 2 files changed, 8 insertions(+) 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(); + } } }