Skip to content

Instantly share code, notes, and snippets.

@jonathanpeppers
Last active August 29, 2015 14:06
Show Gist options
  • Save jonathanpeppers/836bd0cee63ea7dabb7c to your computer and use it in GitHub Desktop.
Save jonathanpeppers/836bd0cee63ea7dabb7c to your computer and use it in GitHub Desktop.
//// General Declarations
var colorSpace = CGColorSpace.CreateDeviceRGB();
var context = UIGraphics.GetCurrentContext();
//// Color Declarations
var color4 = UIColor.FromRGBA(0.761f, 0.678f, 0.310f, 0.000f);
var color5 = UIColor.FromRGBA(0.761f, 0.678f, 0.310f, 0.349f);
//// Gradient Declarations
var defaultGradientForegroundToTransparentForegroundToTransparentColors = new CGColor [] {color4.CGColor, color5.CGColor};
var defaultGradientForegroundToTransparentForegroundToTransparentLocations = new float [] {0.9f, 1.0f};
var defaultGradientForegroundToTransparentForegroundToTransparent = new CGGradient(colorSpace, defaultGradientForegroundToTransparentForegroundToTransparentColors, defaultGradientForegroundToTransparentForegroundToTransparentLocations);
//// Group 6
{
//// Rectangle 19 Drawing
UIBezierPath rectangle19Path = new UIBezierPath();
rectangle19Path.MoveTo(new PointF(0.0f, 0.0f));
rectangle19Path.AddLineTo(new PointF(2048.0f, 0.0f));
rectangle19Path.AddLineTo(new PointF(2048.0f, 704.0f));
rectangle19Path.AddLineTo(new PointF(0.0f, 704.0f));
rectangle19Path.AddLineTo(new PointF(0.0f, 0.0f));
rectangle19Path.ClosePath();
context.SaveState();
rectangle19Path.AddClip();
context.DrawLinearGradient(defaultGradientForegroundToTransparentForegroundToTransparent,
new PointF(1024.0f, 704.0f),
new PointF(1024.0f, 0.0f),
CGGradientDrawingOptions.DrawsBeforeStartLocation | CGGradientDrawingOptions.DrawsAfterEndLocation);
context.RestoreState();
//// Group 4
{
context.SaveState();
context.TranslateCTM(0.0f, 1456.0f);
context.SetAlpha(0.29f);
context.BeginTransparencyLayer();
context.EndTransparencyLayer();
context.RestoreState();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment