Skip to content

Commit

Permalink
Fix Issue #40: Alpha is set back to 1 when the colour changes
Browse files Browse the repository at this point in the history
  • Loading branch information
avacreeth committed Feb 17, 2017
1 parent aed0284 commit 0f5a637
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/mixin/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ function _colorChange (data, oldHue) {
data.a = 1
}

var color = data.hex ? tinycolor(data.hex) : tinycolor(data)
var color
if (data.hex) {
color = tinycolor(data.hex)
color.setAlpha(data.a || 1)
} else {
color = tinycolor(data)
}
var hsl = color.toHsl()
var hsv = color.toHsv()
if (hsl.s === 0) {
Expand Down

0 comments on commit 0f5a637

Please sign in to comment.