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 f1447fa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/mixin/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ function _colorChange (data, oldHue) {
data.a = 1
}

var color = data.hex ? tinycolor(data.hex) : tinycolor(data)
data.a = data.a || 1

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

0 comments on commit f1447fa

Please sign in to comment.