mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Defer require until a Color is parsed
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
_ = require 'underscore-plus'
|
||||
ParsedColor = require 'color'
|
||||
ParsedColor = null
|
||||
|
||||
# Essential: A simple color class returned from {Config::get} when the value
|
||||
# at the key path is of type 'color'.
|
||||
@@ -16,6 +16,8 @@ class Color
|
||||
return null if _.isArray(value) or _.isFunction(value)
|
||||
return null unless _.isObject(value) or _.isString(value)
|
||||
|
||||
ParsedColor ?= require 'color'
|
||||
|
||||
try
|
||||
parsedColor = new ParsedColor(value)
|
||||
catch error
|
||||
|
||||
Reference in New Issue
Block a user