[hamster-applet] allow also to specify opacity in fill_area



commit 71cc6eb54abc56d84155858d0736ac71e7c56c88
Author: Toms Bauģis <toms baugis gmail com>
Date:   Sun Jun 14 11:57:40 2009 +0100

    allow also to specify opacity in fill_area

 hamster/graphics.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/hamster/graphics.py b/hamster/graphics.py
index 96b0eb6..0b51b31 100644
--- a/hamster/graphics.py
+++ b/hamster/graphics.py
@@ -140,7 +140,11 @@ class Area(gtk.DrawingArea):
     def fill_area(self, x, y, w, h, color):
         if color[0] > 1: color = [c / 256.0 for c in color]
 
-        self.context.set_source_rgb(*color)
+        if len(color) == 3:
+            self.context.set_source_rgb(*color)
+        else:
+            self.context.set_source_rgba(*color)
+            
         self.context.rectangle(x, y, w, h)
         self.context.fill()
 



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