# The vanilla processing background method is highly overloaded, a single # argument could be an instance of PImage, int or float (multiple arguments are # usually taken to be floats). # @param *args arguments for background as an Array # def background *args if (args.length == 1) if args[0].kind_of? Integer self.java_send :background, [Java::int], args[0] elsif args[0].kind_of? Float self.java_send :background, [Java::float], args[0] elsif args[0].kind_of? Java::ProcessingCore::PImage self.java_send :background, [Java::ProcessingCore::PImage], args[0] end elsif (args.length == 3) self.java_send :background, [Java::float, Java::float, Java::float], args[0], args[1], args[2] elsif (args.length == 2) # greyscale with transparency self.java_send :background, [Java::float, Java::float], args[0], args[1] elsif (args.length == 4) # color with transparency self.java_send :background, [Java::float, Java::float, Java::float, Java::float], args[0], args[1], args[2], args[3] end end
JRubyArt is the development branch of ruby-processing.
No comments:
Post a Comment