[goocanvasmm] Replace deprecated Gdk::Color.



commit 453132666907a501bb2b7f0b6db36422fdfafdb3
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Dec 16 11:58:25 2016 +0100

    Replace deprecated Gdk::Color.

 examples/demo/primitives.cc |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/examples/demo/primitives.cc b/examples/demo/primitives.cc
index 92c8099..6ccabd2 100644
--- a/examples/demo/primitives.cc
+++ b/examples/demo/primitives.cc
@@ -474,10 +474,10 @@ Primitives::_create_stipple(const Glib::ustring& color)
       0, 0, 0, 255
     };
 
-  Gdk::Color c(color);
-  data[2] = data[14] = c.get_red() << 8 ;
-  data[1] = data[13] = c.get_green() << 8 ;
-  data[0] = data[12] = c.get_blue() << 8 ;
+  Gdk::RGBA c(color);
+  data[2] = data[14] = c.get_red() * 255;
+  data[1] = data[13] = c.get_green() * 255;
+  data[0] = data[12] = c.get_blue() * 255;
 
   auto surface = Cairo::ImageSurface::create(data, Cairo::FORMAT_ARGB32, 2, 2, 8);
   auto pattern = Cairo::SurfacePattern::create(surface);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]