Sha256: ec952c34838afdc27ed93db39e7d58b9d45b2c0277ed10f865a8300c88cb8555

Contents?: true

Size: 692 Bytes

Versions: 3

Compression:

Stored size: 692 Bytes

Contents

# by Martin Prout

require 'cf3'

def setup_the_sun
  @sun = ContextFree.define do

    shape :start do
      rot = 0
      split do
        12.times do
          legs rotation: rot
          rot += 30
          rewind
        end
        legs rotation: 360
      end
    end

    shape :legs do
      circle
      legs rotation: 1, y: 0.1,
      size: 0.973, color: [0.22, 0.15]
    end

  end
end

def settings
  size 600, 600
end

def setup
  sketch_title 'Dark Star'
  setup_the_sun
  no_stroke
  color_mode HSB, 1.0
  draw_it
end

def draw
  # Do nothing.
end

def draw_it
  background 0.7
  @sun.render :start, size: height/7,  stop_size: 0.8,
  start_x: width/2, start_y: height/2
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cf3-1.2.0 samples/dark_star.rb
cf3-1.0.1 samples/dark_star.rb
cf3-1.0.0 samples/dark_star.rb