 Backbone = require "backbone"
 
 BokehView = require "../../core/bokeh_view"
+{color2rgba} = require "../../core/util/color"
 {logger} = require "../../core/logging"
 p = require "../../core/properties"
 mixins = require "../../core/property_mixins"

    @cache_select("fill_alpha", i)
    if ctx.globalAlpha != @cache.fill_alpha
      ctx.globalAlpha = @cache.fill_alpha

class _Text extends _ContextProperties


    font_size  = @text_font_size.value()
    font_style = @text_font_style.value()
    return font_style + " " + font_size + " " + font

  color_value: () ->
    color = color2rgba(@text_color.value(), @text_alpha.value())
    return "rgba(#{color[0]*255},#{color[1]*255},#{color[2]*255},#{color[3]})"

  set_value: (ctx) ->
    ctx.font         = @font_value()
