Guest User

Untitled

a guest
Jul 16th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. CGFloat BGLocations[2] = { 0.0, 1.0 };
  2. CGFloat BgComponents[8] = { 1.0, 1.0, 1.0 , 1.0, // Start color
  3. 0.9, 0.9, 0.9 , 1.0 }; // Mid color and End color
  4. CGColorSpaceRef BgRGBColorspace = CGColorSpaceCreateDeviceRGB();
  5. CGGradientRef bgRadialGradient = CGGradientCreateWithColorComponents(BgRGBColorspace, BgComponents, BGLocations, 2);
  6.  
  7.  
  8. //[UIColor colorWithRed:110/255.0 green:12/255.0 blue:15/255.0 alpha:1.0];
  9. CGPoint startBg = CGPointMake(_gridWidth/2,_gridHeight/2);
  10. CGFloat endRadius=MAX(_gridWidth/2, _gridHeight/2);
  11.  
  12. CGContextDrawRadialGradient(ctx, bgRadialGradient, startBg, 0, startBg, endRadius, kCGGradientDrawsAfterEndLocation);
  13.  
  14. CGColorSpaceRelease(BgRGBColorspace);
  15. CGGradientRelease(bgRadialGradient);
Add Comment
Please, Sign In to add comment