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#)