-make_chart = (svg_id, bug_stats, max_turns, max_bugs) ->
+make_chart = (svg_id, bug_stats, max_turns, max_bugs, colors) ->
   $(svg_id).empty()
 
   xScale     = new Plottable.Scale.Linear().domain([0, max_turns])
   yScale     = new Plottable.Scale.Linear().domain([0, max_bugs])
-  colorScale = new Plottable.Scale.Color("10")
+  colorScale = new Plottable.Scale.Color().range(colors)
 
   xAxis  = new Plottable.Axis.Numeric(xScale, "bottom")
   yAxis  = new Plottable.Axis.Numeric(yScale, "left")

  render_game canvas, bugs

  if bugs.turns % 10 == 0
    stats = bugs.names.map((name) -> bugs.stats[name])
    make_chart '#jitterbug_progress_chart_svg', stats, bugs.max_turns, bugs.count

  if bugs.turns < bugs.max_turns
    bugs.turns += 1
    setTimeout((-> next_turn bugs, canvas), 50)

starting_bugs = (bug_size, width, height, max_turns) ->
  grid = []

  for x in [0..(width - 1)]

    next_serial: 0
    stats:       {}
    names:       []
    color_scale: color_scale
    next_color:  color_scale.map((color) -> color.name).reverse()
    turns:       0
    count:       0
    bug_size:    bug_size
