updated top the the new version of attachment_fu plugin to work out some
[selectricity-live] / vendor / plugins / attachment_fu / vendor / red_artisan / core_image / filters / color.rb
diff --git a/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/color.rb b/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/color.rb
new file mode 100644 (file)
index 0000000..f593b90
--- /dev/null
@@ -0,0 +1,27 @@
+module RedArtisan
+  module CoreImage
+    module Filters
+      module Color
+        
+        def greyscale(color = nil, intensity = 1.00)
+          create_core_image_context(@original.extent.size.width, @original.extent.size.height)
+          
+          color = OSX::CIColor.colorWithString("1.0 1.0 1.0 1.0") unless color
+          
+          @original.color_monochrome :inputColor => color, :inputIntensity => intensity do |greyscale|
+            @target = greyscale
+          end
+        end
+        
+        def sepia(intensity = 1.00)
+          create_core_image_context(@original.extent.size.width, @original.extent.size.height)
+          
+          @original.sepia_tone :inputIntensity => intensity do |sepia|
+            @target = sepia
+          end
+        end
+        
+      end
+    end
+  end
+end
\ No newline at end of file

Benjamin Mako Hill || Want to submit a patch?