 		repeat = true
 		nb_iters = 0
 		centroids = null
-		
+
 		# get seed values
 		centroids = []
 		centroids.push min
 		for i in [1..num-1]
 			centroids.push min + (i/num) * (max-min)
 		centroids.push max
-		
+
 		while repeat
 			# assignment step
 			for j in [0..num-1]

	max = Math.max(r, g, b)

	l = (max + min) / 2
	
	if max == min
		s = 0
		h = undefined



class Diverging extends ColorScale

	constructor: (col0='#d73027', col1='#ffffbf', col2='#1E6189', center='mean', mode='hsl') ->
		me=@
		me.mode = mode
		me.center = center
		super [col0,col1,col2], [0,.5,1], mode

	parseData: (data, data_col) ->
		super data, data_col
		me = @
