@@ -4,6 +4,7 @@ import { escapeRegExp } from 'underscore-plus'
44import Mixin from 'mixto'
55
66import * as Main from '../main'
7+ import { domStylesReader } from '../main'
78import CanvasLayer from '../canvas-layer'
89
910const SPEC_MODE = atom . inSpecMode ( )
@@ -28,6 +29,7 @@ export default class CanvasDrawer extends Mixin {
2829 this . drawHighlightDecoration = drawHighlightDecoration
2930 this . drawHighlightOutlineDecoration = drawHighlightOutlineDecoration
3031 this . drawCustomDecoration = drawCustomDecoration
32+ this . DOMStylesReader = domStylesReader
3133 }
3234
3335 /**
@@ -303,7 +305,7 @@ export default class CanvasDrawer extends Mixin {
303305 * @return {string } a CSS color
304306 */
305307 getDefaultColor ( editorElement ) {
306- const color = this . DOMStylesReader . retrieveStyleFromDom ( [ '.editor' ] , 'color' , editorElement , true )
308+ const color = domStylesReader . retrieveStyleFromDom ( [ '.editor' ] , 'color' , editorElement , true )
307309 return transparentize ( color , this . textOpacity )
308310 }
309311
@@ -318,7 +320,7 @@ export default class CanvasDrawer extends Mixin {
318320 * @return {string } the CSS color for the provided token
319321 */
320322 getTokenColor ( scopes , editorElement ) {
321- const color = this . DOMStylesReader . retrieveStyleFromDom ( scopes , 'color' , editorElement , true )
323+ const color = domStylesReader . retrieveStyleFromDom ( scopes , 'color' , editorElement , true )
322324
323325 return transparentize ( color , this . textOpacity )
324326 }
@@ -340,7 +342,7 @@ export default class CanvasDrawer extends Mixin {
340342
341343 if ( properties . scope ) {
342344 const scopeString = properties . scope . split ( oneOrMoreWhiteSpaceRegexp )
343- return this . DOMStylesReader . retrieveStyleFromDom ( scopeString , 'background-color' , editorElement , true )
345+ return domStylesReader . retrieveStyleFromDom ( scopeString , 'background-color' , editorElement , true )
344346 } else {
345347 return this . getDefaultColor ( editorElement )
346348 }
0 commit comments