From adb0939ace35451f7baa6a4a89a25d0fd823084a Mon Sep 17 00:00:00 2001 From: Erika Bueno Date: Sun, 1 Oct 2017 18:26:29 -0300 Subject: [PATCH] Add support for MacOS --- src/templates/hex-to-ui.html | 18 ++++++++++++++++-- src/templates/rgb-to-ui.html | 19 +++++++++++++++++-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/templates/hex-to-ui.html b/src/templates/hex-to-ui.html index 6d00d37..9772c09 100644 --- a/src/templates/hex-to-ui.html +++ b/src/templates/hex-to-ui.html @@ -45,17 +45,31 @@

{{ title }}

-

Objective-C

+

Objective-C for iOS

[UIColor colorWithRed:{{uiColor.r}} green:{{uiColor.g}} blue:{{uiColor.b}} alpha:{{alpha}}];
+ +
+

Objective-C for MacOS

+ [NSColor colorWithCalibratedRed:{{uiColor.r}} green:{{uiColor.g}} blue:{{uiColor.b}} alpha:{{alpha}}]; + +
+
-

Swift

+

Swift for iOS

UIColor(red:{{uiColor.r}}, green:{{uiColor.g}}, blue:{{uiColor.b}}, alpha:{{alpha}})
+ + +
+

Swift for MacOS

+ NSColor(calibratedRed:{{uiColor.r}}, green:{{uiColor.g}}, blue:{{uiColor.b}}, alpha:{{alpha}}) + +
diff --git a/src/templates/rgb-to-ui.html b/src/templates/rgb-to-ui.html index ef758ec..9da9261 100644 --- a/src/templates/rgb-to-ui.html +++ b/src/templates/rgb-to-ui.html @@ -57,18 +57,33 @@

{{ title }}

-

Objective-C

+

Objective-C for iOS

[UIColor colorWithRed:{{uiColor.r}} green:{{uiColor.g}} blue:{{uiColor.b}} alpha:{{alpha}}];
+ + +
+

Objective-C for MacOS

+ [NSColor colorWithCalibratedRed:{{uiColor.r}} green:{{uiColor.g}} blue:{{uiColor.b}} alpha:{{alpha}}]; + +
+
-

Swift

+

Swift for iOS

UIColor(red:{{uiColor.r}}, green:{{uiColor.g}}, blue:{{uiColor.b}}, alpha:{{alpha}})
+ +
+

Swift for MacOS

+ NSColor(calibratedRed:{{uiColor.r}}, green:{{uiColor.g}}, blue:{{uiColor.b}}, alpha:{{alpha}}) + +
+

Xamarin (C#)