Skip to content

Commit

Permalink
Fix the alpha not being copied out correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Fouquet committed Jan 27, 2017
1 parent 498b076 commit 370535a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Color Copier.sketchplugin/Contents/Sketch/hsla.cocoascript
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var copyHslaFill = function(context) {
var hue
var saturation
var lightness = (max + min) / 2
var alpha = selectedColor.alpha()
var alpha = +selectedColor.alpha().toFixed(2)

if (max === min) {
hue = 0
Expand Down
2 changes: 1 addition & 1 deletion Color Copier.sketchplugin/Contents/Sketch/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "Michael Fouquet",
"authorEmail": "michael.fouquet@me.com",
"homepage": "https://github.com/mfouquet/color-copier",
"version" : "2.0",
"version" : "2.1",
"compatibleVersion": 3,
"identifier" : "com.mfouquet.sketch.color-copier",
"commands" : [
Expand Down
6 changes: 3 additions & 3 deletions Color Copier.sketchplugin/Contents/Sketch/rgba.cocoascript
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ var copyRgbaFill = function(context) {
var red = Math.round(selectedColor.red() * 255)
var green = Math.round(selectedColor.green() * 255)
var blue = Math.round(selectedColor.blue() * 255)
var alpha = selectedColor.alpha()
var alpha = +selectedColor.alpha().toFixed(2)

clipboard.set(red + ", " + green + ", " + blue)
clipboard.set(red + ", " + green + ", " + blue + ", " + alpha)

var doc = context.document
doc.showMessage("Fill color RGBA [ "
Expand All @@ -38,7 +38,7 @@ var copyRgbaBorder = function(context) {
var red = Math.round(selectedColor.red() * 255)
var green = Math.round(selectedColor.green() * 255)
var blue = Math.round(selectedColor.blue() * 255)
var alpha = selectedColor.alpha()
var alpha = +selectedColor.alpha().toFixed(2)

clipboard.set(red + ", " + green + ", " + blue + ", " + alpha)

Expand Down

0 comments on commit 370535a

Please sign in to comment.