Here is an example sketch by Joshua Davis, from the hype framework that has been changed to make use of ruby syntax. The declared aim of the hype library is to provide:- A collection of classes that performs the heavy lifting so that you can create sketches with the minimum amount of code. When using the hype library to create JRubyArt sketches it is suggested that you not simply ape the hype framework examples, but tailor your sketches to take advantage of the ruby language to create even more elegant code (Code as Art), not that it is relevant here.

Unzip the library in the processing libraries folder, rename the folder hype, rename distribution folder to library, rename the HYPE.jar to hype.jar. Check that you can see the library from the processing-3.2.1 ide. Note that we can use snake case in place of camel case, for constants use :: and not . to call. The important thing to learn from this sketch is how to implement the HCallback interface. This can be implemented as a closure (block), note we do not/should not try and use the vanilla processing method.

In this case we use the web_to_color_array convenience method (since JRubyArt-1.0.7) to create a hash of color int with symbol keys. Note that hype constants require the H:: prefix, whereas processing constants do not (because we already include the PConstants interface).


# encoding: utf-8
load_library :hype
include_package 'hype'
java_import 'hype.extended.behavior.HProximity'
java_import 'hype.extended.behavior.HOscillator'

PALETTE = %w(#242424 #00FF00 #FF3300 #4D4D4D).freeze
KEY = %i(background fill_one fill_two stroke).freeze

attr_reader :colors

def settings
  size(640, 640)

def setup
  sketch_title 'Hype Proximity'
  @colors =
  canvas = H.add(
  r1 =
    .loc(width/2, height/2)
  r2 =, 10)
    .y(height / 2)
             .range(40, 600)

def draw
  # outline to show area of proximity  
  ellipse(width / 2, height / 2, 500, 500)