From bb9c690a67e36a1afae6c2bac8bc945c078db031 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 20 Aug 2009 15:29:58 +0200 Subject: [PATCH] Add method to convert a synfig::Color to a Gdk::Color. --- synfig-studio/src/gtkmm/widget_color.cpp | 9 +++++++++ synfig-studio/src/gtkmm/widget_color.h | 1 + 2 files changed, 10 insertions(+) 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); -- 2.7.4