From b9c531cf7f945ea30a9f098a80f6cee11d5fe3e9 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Thu, 9 Jan 2025 11:03:19 -0600 Subject: [PATCH] Allow peeking at the next round-robin color to be used --- gtk2_ardour/utils.cc | 6 +++++- gtk2_ardour/utils.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 84d2c40b0b..5887e70c08 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -711,7 +711,7 @@ ARDOUR_UI_UTILS::escape_underscores (string const& s) } Gdk::Color -ARDOUR_UI_UTILS::round_robin_palette_color () +ARDOUR_UI_UTILS::round_robin_palette_color (bool just_peek) { Gdk::Color newcolor; string cp = UIConfiguration::instance ().get_stripable_color_palette (); @@ -719,6 +719,10 @@ ARDOUR_UI_UTILS::round_robin_palette_color () std::vector c (gc); static std::vector::size_type index = 0; + if(just_peek) { + return c[index]; + } + if (index >= c.size ()) { index = 0; } diff --git a/gtk2_ardour/utils.h b/gtk2_ardour/utils.h index d523c52827..ed378e49cd 100644 --- a/gtk2_ardour/utils.h +++ b/gtk2_ardour/utils.h @@ -100,7 +100,7 @@ void resize_window_to_proportion_of_monitor (Gtk::Window*, int, int); std::string escape_underscores (std::string const &); -Gdk::Color round_robin_palette_color (); +Gdk::Color round_robin_palette_color (bool just_peek = false); Gdk::Color unique_random_color (std::list &); std::string rate_as_string (float r);