Always use settings for parsing

This commit is contained in:
Kevin Sawicki
2015-01-09 11:25:59 -08:00
parent 3f224716a1
commit e257395f7d

View File

@@ -25,11 +25,6 @@ class Color
new Color(parsedColor.red(), parsedColor.green(), parsedColor.blue(), parsedColor.alpha())
constructor: (red, green, blue, alpha) ->
red = parseColor(red)
green = parseColor(green)
blue = parseColor(blue)
alpha = parseColor(alpha)
Object.defineProperties this,
red:
set: (newRed) -> red = parseColor(newRed)
@@ -52,6 +47,11 @@ class Color
enumerable: true
configurable: false
@red = red
@green = green
@blue = blue
@alpha = alpha
# Esssential: Returns a {String} in the form `'#abcdef'`.
toHexString: ->
"##{numberToHexString(@red)}#{numberToHexString(@green)}#{numberToHexString(@blue)}"