Skip to content

Commit 1d7c5fc

Browse files
committed
Port to Objective-C
1 parent daad3ad commit 1d7c5fc

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

Copy Swift Code.sketchplugin/Contents/Sketch/manifest.json renamed to Copy Objective-C Code.sketchplugin/Contents/Sketch/manifest.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"author": "Atsushi Nagase",
2+
"author": "Jaime Zaragoza",
33
"commands" : [
44
{
55
"script" : "script.cocoascript",
@@ -21,12 +21,12 @@
2121
"copy-ui-color",
2222
"copy-ns-color"
2323
],
24-
"title" : "Copy Swift Code"
24+
"title" : "Copy Objective-C Code"
2525
},
26-
"identifier" : "io.ngs.sketchplugin.swift-color",
26+
"identifier" : "com.jaimeeee.sketchplugin.objc-color",
2727
"version" : "1.0",
28-
"description": "Copy fill color as Swift code",
29-
"homepage": "http://github.com/ngs/sketchplugin-swift-color",
30-
"authorEmail" : "a@ngs.io",
31-
"name" : "Copy Swift Code"
28+
"description": "Copy fill color as Objective-C code",
29+
"homepage": "https://github.com/jaimeeee/sketchplugin-objc-color",
30+
"authorEmail" : "hola@jaimeeee.com",
31+
"name" : "Copy Objective-C Code"
3232
}

Copy Swift Code.sketchplugin/Contents/Sketch/script.cocoascript renamed to Copy Objective-C Code.sketchplugin/Contents/Sketch/script.cocoascript

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ function generateCode(initializer, context) {
2626
, color = fill.color()
2727
;
2828
res.push(
29-
'let ' + varName +
29+
initializer + ' *' + varName +
3030
(varCount > 1 ? varCount : '') +
31-
' = ' + initializer + '(' +
32-
'red: ' + color.red() + ', ' +
33-
'green: ' + color.green() + ', ' +
34-
'blue: ' + color.blue() + ', ' +
35-
'alpha: ' + color.alpha() + ')'
31+
' = [' + initializer + ' ' +
32+
'colorWithRed:' + color.red() + ' ' +
33+
'green:' + color.green() + ' ' +
34+
'blue:' + color.blue() + ' ' +
35+
'alpha:' + color.alpha() + '];'
3636
);
3737
}
3838
}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Copy Swift Code [Sketch] Plugin
1+
Copy Objective-C Code [Sketch] Plugin
22
===============================
33

4-
Copy fill color as Swift code
4+
Copy fill color as Objective-C code
55

66
![Screen](screen.gif)
77

@@ -13,13 +13,13 @@ Download and unarchive latest version from [Releases] page.
1313
Author
1414
------
1515

16-
[Atsushi NAGASE](http://ngs.io)
16+
[Jaime Zaragoza](http://jaimeeee.com) based on the work of [Atsushi NAGASE](http://ngs.io)
1717

1818
License
1919
-------
2020

2121
See [LICENSE]
2222

2323
[Sketch]: http://www.sketchapp.com
24-
[Releases]: https://github.com/ngs/sketchplugin-swift-color/releases
24+
[Releases]: https://github.com/jaimeeee/sketchplugin-objc-color/releases
2525
[LICENSE]: ./LICENSE

screen.gif

515 KB
Loading

0 commit comments

Comments
 (0)