[cairo-commit] rcairo/src/lib/cairo color.rb,1.7,1.8

Kouhei Sutou commit at pdx.freedesktop.org
Sun Jan 10 18:05:15 PST 2010


Committed by: kou

Update of /cvs/cairo/rcairo/src/lib/cairo
In directory kemper:/tmp/cvs-serv18239/src/lib/cairo

Modified Files:
	color.rb 
Log Message:
* src/lib/cairo/color.rb: add Color::RGB#==, Color::RGB#hash, Color::RGB#eql?.


Index: color.rb
===================================================================
RCS file: /cvs/cairo/rcairo/src/lib/cairo/color.rb,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- color.rb	1 May 2007 11:49:43 -0000	1.7
+++ color.rb	11 Jan 2010 02:05:12 -0000	1.8
@@ -88,6 +88,18 @@
         @blue = b
       end
 
+      def hash
+        to_s.hash
+      end
+
+      def eql?(other)
+        self == other
+      end
+
+      def ==(other)
+        other.is_a?(self.class) and other.to_s == to_s
+      end
+
       def to_a
         [@red, @green, @blue, @alpha]
       end



More information about the cairo-commit mailing list