diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index c1de612c9f..6ad6d9bb3c 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -264,6 +264,22 @@ ARDOUR_UI_UTILS::get_font_for_style (string widgetname) return Pango::FontDescription (pfd); /* make a copy */ } +Gdk::Color +ARDOUR_UI_UTILS::gdk_color_from_rgb (uint32_t rgb) +{ + Gdk::Color c; + set_color_from_rgb (c, rgb); + return c; +} + +Gdk::Color +ARDOUR_UI_UTILS::gdk_color_from_rgba (uint32_t rgba) +{ + Gdk::Color c; + set_color_from_rgb (c, rgba); + return c; +} + void ARDOUR_UI_UTILS::set_color_from_rgb (Gdk::Color& c, uint32_t rgb) { diff --git a/gtk2_ardour/utils.h b/gtk2_ardour/utils.h index bdc05643a5..51b9ca22c3 100644 --- a/gtk2_ardour/utils.h +++ b/gtk2_ardour/utils.h @@ -62,9 +62,13 @@ Pango::FontDescription get_font_for_style (std::string widgetname); void decorate (Gtk::Window& w, Gdk::WMDecoration d); +Gdk::Color gdk_color_from_rgb (uint32_t); +Gdk::Color gdk_color_from_rgba (uint32_t); +uint32_t gdk_color_to_rgba (Gdk::Color const&); + void set_color_from_rgb (Gdk::Color&, uint32_t); void set_color_from_rgba (Gdk::Color&, uint32_t); -uint32_t gdk_color_to_rgba (Gdk::Color const&); + uint32_t contrasting_text_color (uint32_t c); bool relay_key_press (GdkEventKey* ev, Gtk::Window* win);