#LY1C #ImolaYellow #PaintCode https://www.instagram.com/p/CaHsB0hIjH6/?utm_medium=tumblr
seen from United States

seen from Malaysia
seen from United States
seen from United States

seen from Türkiye
seen from Australia
seen from Brazil

seen from United States

seen from Canada

seen from United States
seen from China
seen from United States
seen from China

seen from Türkiye

seen from United States

seen from Malaysia
seen from United States
seen from United States
seen from Indonesia
seen from United States
#LY1C #ImolaYellow #PaintCode https://www.instagram.com/p/CaHsB0hIjH6/?utm_medium=tumblr
Exporter des couleurs et des dégradé en format code Objective-C et Swift
Came across CGGradientRef while working with PaintCode. Here’s a short example of using CGGradientRef.. uh maybe omit that last release.
PaintCode is a vector drawing application for MacOS that generates Objective-C code for direct use in your Xcode project.
How to clone the bottom bar notifications badge in 1 step
Using the brilliant tool paintcode has been very easy to reproduce the small notification badge in way that can be used anywhere in your app; to draw it just paste the code below in your UIView drawRect method.
Enjoy :)
//// General Declarations CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef context = UIGraphicsGetCurrentContext(); //// Color Declarations UIColor* fillColor = [UIColor colorWithRed: 1 green: 1 blue: 1 alpha: 1]; UIColor* base_color = [UIColor colorWithRed: 0.855 green: 0.031 blue: 0.071 alpha: 1]; CGFloat base_colorRGBA[4]; [base_color getRed: &base_colorRGBA[0] green: &base_colorRGBA[1] blue: &base_colorRGBA[2] alpha: &base_colorRGBA[3]]; UIColor* color2 = [UIColor colorWithRed: (base_colorRGBA[0] * 0.5 + 0.5) green: (base_colorRGBA[1] * 0.5 + 0.5) blue: (base_colorRGBA[2] * 0.5 + 0.5) alpha: (base_colorRGBA[3] * 0.5 + 0.5)]; UIColor* color3 = [UIColor colorWithRed: (base_colorRGBA[0] * 0.7 + 0.3) green: (base_colorRGBA[1] * 0.7 + 0.3) blue: (base_colorRGBA[2] * 0.7 + 0.3) alpha: (base_colorRGBA[3] * 0.7 + 0.3)]; UIColor* gradientColor = [UIColor colorWithRed: 0 green: 0 blue: 0 alpha: 1]; //// Gradient Declarations NSArray* gradientColors = [NSArray arrayWithObjects: (id)color2.CGColor, (id)[UIColor colorWithRed: 0.913 green: 0.419 blue: 0.442 alpha: 1].CGColor, (id)color3.CGColor, (id)[UIColor colorWithRed: 0.877 green: 0.177 blue: 0.21 alpha: 1].CGColor, (id)base_color.CGColor, nil]; CGFloat gradientLocations[] = {0, 0.44, 0.51, 0.57, 1}; CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (__bridge CFArrayRef)gradientColors, gradientLocations); //// Shadow Declarations UIColor* shadow = gradientColor; CGSize shadowOffset = CGSizeMake(0.1, 3.1); CGFloat shadowBlurRadius = 3; //// Frames CGRect frame = self.bounds; //// Abstracted Attributes NSString* textContent = @"99"; //// rank Drawing UIBezierPath* rankPath = [UIBezierPath bezierPath]; [rankPath moveToPoint: CGPointMake(CGRectGetMaxX(frame) - 4.92, CGRectGetMinY(frame) + 16.58)]; [rankPath addCurveToPoint: CGPointMake(CGRectGetMaxX(frame) - 4.92, CGRectGetMinY(frame) + 4.92) controlPoint1: CGPointMake(CGRectGetMaxX(frame) - 1.69, CGRectGetMinY(frame) + 13.36) controlPoint2: CGPointMake(CGRectGetMaxX(frame) - 1.69, CGRectGetMinY(frame) + 8.14)]; [rankPath addCurveToPoint: CGPointMake(CGRectGetMinX(frame) + 5.42, CGRectGetMinY(frame) + 4.92) controlPoint1: CGPointMake(CGRectGetMaxX(frame) - 8.14, CGRectGetMinY(frame) + 1.69) controlPoint2: CGPointMake(CGRectGetMinX(frame) + 8.64, CGRectGetMinY(frame) + 1.69)]; [rankPath addCurveToPoint: CGPointMake(CGRectGetMinX(frame) + 5.42, CGRectGetMinY(frame) + 16.58) controlPoint1: CGPointMake(CGRectGetMinX(frame) + 2.19, CGRectGetMinY(frame) + 8.14) controlPoint2: CGPointMake(CGRectGetMinX(frame) + 2.19, CGRectGetMinY(frame) + 13.36)]; [rankPath addCurveToPoint: CGPointMake(CGRectGetMaxX(frame) - 4.92, CGRectGetMinY(frame) + 16.58) controlPoint1: CGPointMake(CGRectGetMinX(frame) + 8.64, CGRectGetMinY(frame) + 19.81) controlPoint2: CGPointMake(CGRectGetMaxX(frame) - 8.14, CGRectGetMinY(frame) + 19.81)]; [rankPath closePath]; CGContextSaveGState(context); CGContextSetShadowWithColor(context, shadowOffset, shadowBlurRadius, shadow.CGColor); CGContextBeginTransparencyLayer(context, NULL); [rankPath addClip]; CGRect rankBounds = CGPathGetPathBoundingBox(rankPath.CGPath); CGFloat rankResizeRatio = MIN(CGRectGetWidth(rankBounds) / 17.5, CGRectGetHeight(rankBounds) / 16.5); CGContextDrawRadialGradient(context, gradient, CGPointMake(CGRectGetMidX(rankBounds) + 0 * rankResizeRatio, CGRectGetMidY(rankBounds) + -16.66 * rankResizeRatio), 15.05 * rankResizeRatio, CGPointMake(CGRectGetMidX(rankBounds) + 0 * rankResizeRatio, CGRectGetMidY(rankBounds) + -14.71 * rankResizeRatio), 18.09 * rankResizeRatio, kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation); CGContextEndTransparencyLayer(context); CGContextRestoreGState(context); [fillColor setStroke]; rankPath.lineWidth = 2; [rankPath stroke]; //// Text Drawing CGRect textRect = CGRectMake(CGRectGetMinX(frame) + 3.5, CGRectGetMinY(frame) + 4, CGRectGetWidth(frame) - 6, CGRectGetHeight(frame) - 6); [[UIColor whiteColor] setFill]; [textContent drawInRect: textRect withFont: [UIFont fontWithName: @"Helvetica-Bold" size: 11] lineBreakMode: UILineBreakModeWordWrap alignment: UITextAlignmentCenter]; //// Cleanup CGGradientRelease(gradient); CGColorSpaceRelease(colorSpace);
PaintCode
It's no secret that I love Apple's products, and one of the reasons I became a CS major was to be able to make apps for the iPhone. This month was the first time I was truly able to both understand how making applications work, and also begin making apps of my own. One thing I began noticing is how tedious it can be to create UIs and custom drawings in Objective-C. Xcode has Interface Builder built in, but it doesn't allow you to go beyond standard UIs all that much, which makes it more trouble than it's worth for complicated application views. PaintCode is one part of a solution to this problem.
Seems really robust and useful for complex drawings, but not ideal for just laying out simple views. It's also $99.99. Well then, looks like I'll be doing it the hard way for a little while longer.
T
The tool looks promising. Has anyone tried it?