diff --git a/gtk2_ardour/axis_view.cc b/gtk2_ardour/axis_view.cc index cba282dff6..de455aceac 100644 --- a/gtk2_ardour/axis_view.cc +++ b/gtk2_ardour/axis_view.cc @@ -52,8 +52,6 @@ using namespace Gtkmm2ext; using namespace ARDOUR; using namespace ARDOUR_UI_UTILS; -list AxisView::used_colors; - AxisView::AxisView () { } @@ -63,9 +61,9 @@ AxisView::~AxisView() } Gdk::Color -AxisView::unique_random_color() +AxisView::round_robin_palette_color () { - return ARDOUR_UI_UTILS::unique_palette_color (used_colors); + return ARDOUR_UI_UTILS::round_robin_palette_color (); } string diff --git a/gtk2_ardour/axis_view.h b/gtk2_ardour/axis_view.h index afc1cc0a80..d63a410e9d 100644 --- a/gtk2_ardour/axis_view.h +++ b/gtk2_ardour/axis_view.h @@ -122,19 +122,12 @@ public: static GUIObjectState& gui_object_state(); void clear_property_cache() { property_hashtable.clear(); } - /** - * Generate a new random TrackView color, unique from those colors already used. - * - * @return the unique random color. - */ - static Gdk::Color unique_random_color(); + static Gdk::Color round_robin_palette_color (); protected: AxisView (); virtual ~AxisView(); - static std::list used_colors; - Gtk::Label name_label; void set_name_ellipsize_mode (); diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index f081f6f5e4..ea2a524e93 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -367,7 +367,7 @@ RouteUI::set_route (std::shared_ptr rp) if (set_color_from_route()) { if (UIConfiguration::instance().get_use_palette_for_new_route ()) { - set_color (gdk_color_to_rgba (AxisView::unique_random_color ())); + set_color (gdk_color_to_rgba (AxisView::round_robin_palette_color ())); } else { set_color (UIConfiguration::instance ().color (X_("neutral:midground"))); } diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 2241e3e46d..9ee38d12a7 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -680,7 +680,7 @@ ARDOUR_UI_UTILS::escape_underscores (string const & s) } Gdk::Color -ARDOUR_UI_UTILS::unique_palette_color (list& used_colors) +ARDOUR_UI_UTILS::round_robin_palette_color () { Gdk::Color newcolor; string cp = UIConfiguration::instance().get_stripable_color_palette (); diff --git a/gtk2_ardour/utils.h b/gtk2_ardour/utils.h index 3c2a0e2495..4d15f1d2bc 100644 --- a/gtk2_ardour/utils.h +++ b/gtk2_ardour/utils.h @@ -98,7 +98,7 @@ void resize_window_to_proportion_of_monitor (Gtk::Window*, int, int); std::string escape_underscores (std::string const &); -Gdk::Color unique_palette_color (std::list &); +Gdk::Color round_robin_palette_color (); Gdk::Color unique_random_color (std::list &); std::string rate_as_string (float r); diff --git a/gtk2_ardour/vca_master_strip.cc b/gtk2_ardour/vca_master_strip.cc index 8c958e4897..15864fb645 100644 --- a/gtk2_ardour/vca_master_strip.cc +++ b/gtk2_ardour/vca_master_strip.cc @@ -65,7 +65,7 @@ VCAMasterStrip::VCAMasterStrip (Session* s, std::shared_ptr v) if (!_vca->presentation_info().color_set()) { if (UIConfiguration::instance().get_use_palette_for_new_vca ()) { - _vca->presentation_info().set_color (Gtkmm2ext::gdk_color_to_rgba (unique_random_color())); + _vca->presentation_info().set_color (Gtkmm2ext::gdk_color_to_rgba (AxisView::round_robin_palette_color ())); } else { _vca->presentation_info().set_color (UIConfiguration::instance ().color (X_("neutral:midground"))); }