From: David ‘Bombe’ Roden Date: Thu, 20 Aug 2009 13:29:58 +0000 (+0200) Subject: Add method to convert a synfig::Color to a Gdk::Color. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=bb9c690a67e36a1afae6c2bac8bc945c078db031;p=synfig.git Add method to convert a synfig::Color to a Gdk::Color. --- diff --git a/synfig-studio/src/gtkmm/widget_color.cpp b/synfig-studio/src/gtkmm/widget_color.cpp index 2e009b1..213925e 100644 --- a/synfig-studio/src/gtkmm/widget_color.cpp +++ b/synfig-studio/src/gtkmm/widget_color.cpp @@ -64,6 +64,15 @@ studio::colorconv_synfig2gdk(const synfig::Color &c_) return ret; } +synfig::Color +studio::colorconv_gdk2synfig(const Gdk::Color& color, const synfig::ColorReal& alpha) +{ + synfig::Color *synfigColor; + + synfigColor = new synfig::Color(color.get_red_p(), color.get_green_p(), color.get_blue_p(), alpha); + return *synfigColor; +} + void studio::render_color_to_window(const Glib::RefPtr& window,const Gdk::Rectangle& ca,const synfig::Color &color) { diff --git a/synfig-studio/src/gtkmm/widget_color.h b/synfig-studio/src/gtkmm/widget_color.h index 5763bc0..b681b8c 100644 --- a/synfig-studio/src/gtkmm/widget_color.h +++ b/synfig-studio/src/gtkmm/widget_color.h @@ -44,6 +44,7 @@ namespace studio { Gdk::Color colorconv_synfig2gdk(const synfig::Color &c); +synfig::Color colorconv_gdk2synfig(const Gdk::Color &color, const synfig::ColorReal& alpha = 1); void render_color_to_window(const Glib::RefPtr& window,const Gdk::Rectangle& ca,const synfig::Color &color);