Xamarin.iOS solution
public UIImage CreateImageFromColor()
{
var imageSize = new CGSize(30, 30);
var imageSizeRectF = new CGRect(0, 0, 30, 30);
UIGraphics.BeginImageContextWithOptions(imageSize, false, 0);
var context = UIGraphics.GetCurrentContext();
var red = new CGColor(255, 0, 0);
context.SetFillColor(red);
context.FillRect(imageSizeRectF);
var image = UIGraphics.GetImageFromCurrentImageContext();
UIGraphics.EndImageContext();
return image;
}