Last active
August 23, 2018 15:52
Revisions
-
patridge revised this gist
Apr 11, 2014 . No changes.There are no files selected for viewing
-
patridge created this gist
Apr 11, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ // Xamarin.iOS (using MonoTouch.UIKit;) static Random rand = new Random(); public static UIColor GetRandomColor() { int hue = rand.Next(255); UIColor color = UIColor.FromHSB( (hue / 255.0f), 1.0f, 1.0f); return color; } // Xamarin.Android (using Android.Graphics;) static Random rand = new Random(); public static Color GetRandomColor() { int hue = rand.Next(255); Color color = Color.HSVToColor( new[] { hue, 1.0f, 1.0f, } ); return color; }