     x: {field: "text_cx"}, y: {field: "text_cy"},
     text: {field: opts.slice_labels ? "labels"},
     angle: {field: "text_angles"},
-    text_align: "center", text_baseline: "middle", text_font_size: "9pt",
+    text_align: "center", text_baseline: "middle",
+    text_color: {field: "text_colors"}, text_font_size: "9pt",
   })
   r2 = new models.GlyphRenderer({
     data_source: source,

  return result

num2hexcolor = (num) -> sprintf("#%06x", num)

pie = (data, opts) ->
  labels = _.clone(data.labels)

    palette = palettes[opts.palette ? "Spectral11"].map(num2hexcolor)

  colors = ( palette[i % palette.length] for i in [0...normalized_values.length] )
  text_colors = colors.map((c) -> if is_dark(hexcolor2rgb(c)) then "white" else "black")

  to_cartesian = (r, alpha) -> [r*Math.cos(alpha), r*Math.sin(alpha)]

