 
 
 starPoints = () ->
-  innerRadius = innerRadiusElement.val()
+  innerRadius = $innerRadius.val()
   outerRadius = 1;
   innerAngles = [-7*Math.PI/10, -3*Math.PI/10,   Math.PI/10, 5*Math.PI/10,  9*Math.PI/10]
   outerAngles = [-5*Math.PI/10,   -Math.PI/10, 3*Math.PI/10, 7*Math.PI/10, -9*Math.PI/10]



updateInnerRadius = () ->
  $(".rangeslider__handle", innerRadiusElement.$range).text(innerRadiusElement.val())
  refreshStarPath()


$(document).ready () ->
  innerRadiusElement = $("#inner-radius")

  $("#straight").change(setShapeToLinear)
  $("#quadratic").change(setShapeToQuadratic)

  refreshForeground($("#fg-color-picker").spectrum("get"))
  refreshBackground($("#bg-color-picker").spectrum("get"))

  $innerRadius.rangeslider {
    polyfill: false
    onSlide: updateInnerRadius
  }
  $innerRadius.val(0.5).change()
