Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrins committed Jan 13, 2014
2 parents 9e13b6d + f8301b7 commit 0807bcc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spectrum.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@
draggable(slider, function (dragX, dragY) {
currentHue = parseFloat(dragY / slideHeight);
isEmpty = false;
if (!opts.showAlpha) {
currentAlpha = 1;
}
move();
}, dragStart, dragStop);

Expand Down Expand Up @@ -382,6 +385,9 @@
}

isEmpty = false;
if (!opts.showAlpha) {
currentAlpha = 1;
}

move();

Expand Down Expand Up @@ -663,7 +669,7 @@

// Get a format that alpha will be included in (hex and names ignore alpha)
var format = currentPreferredFormat;
if (currentAlpha < 1) {
if (currentAlpha < 1 && !(currentAlpha === 0 && format === "name")) {
if (format === "hex" || format === "hex3" || format === "hex6" || format === "name") {
format = "rgb";
}
Expand Down

0 comments on commit 0807bcc

Please sign in to comment.