Skip to content

Instantly share code, notes, and snippets.

@cutemachine
cutemachine / gradient_view.rb
Created May 10, 2012
GradientView with RubyMotion
View gradient_view.rb
class GradientView < UIView
def initWithFrame(frame)
if super
rgb = CGColorSpaceCreateDeviceRGB()
ptr = Pointer.new(:float, 8)
ptr[0] = 1.0
ptr[1] = 0.0
ptr[2] = 0.0
ptr[3] = 1.0
ptr[4] = 0.0