def grad_position(color_list, index, default, radial = Sass::Script::Bool.new(false))
assert_type color_list, :List
stop = color_list.value[index.value - 1].stop
if stop && radial.to_bool
orig_stop = stop
if stop.unitless?
if stop.value <= 1
stop = stop.times(Sass::Script::Number.new(100, ["%"]))
else
stop = stop.times(Sass::Script::Number.new(1, ["px"]))
end
end
if stop.numerator_units == ["%"] && color_list.value.last.stop && color_list.value.last.stop.numerator_units == ["px"]
stop = stop.times(color_list.value.last.stop).div(Sass::Script::Number.new(100, ["%"]))
end
Compass::Logger.new.record(:warning, "Webkit only supports pixels for the start and end stops for radial gradients. Got: #{orig_stop}") if stop.numerator_units != ["px"]
stop.div(Sass::Script::Number.new(1, stop.numerator_units, stop.denominator_units))
elsif stop
stop
else
default
end
end