       @tokenColorCache[flatScopes] = color
     @tokenColorCache[flatScopes]
 
+  # Returns the background color for the passed-in `decoration` object.
+  #
+  # The color value is read from the DOM by creating a node structure
+  # that match the decoration `scope` property unless the decoration
+  # provides its own `color` property.
+  #
+  # decoration - A `Decoration` object.
+  #
+  # Returns a {String}.
   getDecorationColor: (decoration) ->
     properties = decoration.getProperties()
     return properties.color if properties.color?

      @decorationColorCache[properties.scope] = color
    @decorationColorCache[properties.scope]

  # This function insert a dummy token element in the DOM to compute its style,
  # return the specified property, and remove the element from the DOM.
  retrieveStyleFromDom: (scopes, property) ->
    @ensureDummyNodeExistence()


  #    ##    ## ##     ## ##       ##     ## ##    ##  ##    ##
  #     ######   #######  ########  #######  ##     ##  ######

  # Returns the default text color for an editor content.
  #
  # The color value is directly read from the `EditorView` computed
  # styles.
  #
  # Returns a {String}.
  getDefaultColor: ->
    @transparentize(@minimapView.editorView.css('color'), @getTextOpacity())

  # Returns the text color for the passed-in `token` object.
  #
  # The color value is read from the DOM by creating a node structure
  # that match the token `scope` property.
  #
  # token - A token {Object}.
  #
  # Returns a {String}.
  getTokenColor: (token) ->
    #Retrieve color from cache if available
    flatScopes = token.scopes.join()
