Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
3068b78
added more generic shadow drawing
echoz May 3, 2012
7ad0d8f
alignment for default shadow opacity
echoz May 3, 2012
9c5232b
pretty tab bar now draws an upwards and downwards shadow
echoz May 3, 2012
43f40e5
renamed selector to fit camel case
echoz May 3, 2012
135484e
don't draw if opacity is 0.
echoz May 3, 2012
e9e79f0
initial skeleton for PrettyTabBarButton
echoz May 4, 2012
6580196
Set a mode to use PrettyTabBarButtons instead of UITabBarButtons.
echoz May 4, 2012
92dec25
added PrettyTabBarButton class
echoz May 4, 2012
5c88dfc
some text drawing options plus drawing of text in the correct spot
echoz May 4, 2012
efb9247
if badge value changes, we should update the view's badge value too.
echoz May 4, 2012
457907d
observe badgeValue and update accordingly.
echoz May 4, 2012
024c513
draw selection background. updated highlighted text to one that's mor…
echoz May 4, 2012
02d8ea5
initial drawing of badges
echoz May 4, 2012
241e719
setup options for badge
echoz May 4, 2012
17bdab1
draws badges according to font size.
echoz May 4, 2012
cd6811a
adjusted opacity values. added todos
echoz May 4, 2012
8444b94
default values for text colors and highlights
echoz May 4, 2012
ad8822a
activate pretty tab bar buttons
echoz May 4, 2012
0bf6801
customize badge text color and also working gradients for badge
echoz May 5, 2012
b3f59cd
CF like method to return a mutable path that is in the shape of a rou…
echoz May 5, 2012
9f5fe0f
make sure when switching, buttons that are selected will be in the co…
echoz May 5, 2012
5206138
more options for customization
echoz May 5, 2012
c213ccc
tightly coupled interfaces to deal with selection of tab bar
echoz May 6, 2012
43223ca
internal method to handle resetting of selections of prettytabbarbuttons
echoz May 6, 2012
e93edd8
documentation for PrettyTabBarButton
echoz May 6, 2012
4607a00
switched to using a UIControl subclass. Clearer separation between Vi…
echoz May 6, 2012
62fc918
set custom prettytabbarbutton properties
echoz May 6, 2012
e475503
set correct alignment for assignment of button properties
echoz May 6, 2012
b490332
draw gradient tint using tint gradient colors specified.
echoz May 6, 2012
fb43356
use proper sizes when rendering images
echoz May 6, 2012
e302b11
proper memory management
echoz May 6, 2012
f622216
added configuration for the highlighted image's gradient start and en…
echoz May 6, 2012
79ad15e
more logical layout of code. helps with memory management of observat…
echoz May 6, 2012
708d220
forgot to check for if items count is equal to 0 here.
echoz May 6, 2012
b040cc0
forgot to check for if items count is equal to 0 here.
echoz May 6, 2012
93238b8
Merge branch 'master' into f6222169d60127a33b7789df688e99b7ca35d8fe
echoz May 6, 2012
abbe52c
forgotten to intercept setting of items and rebuilding the representa…
echoz May 6, 2012
5a173c0
Merge branch 'master' into f6222169d60127a33b7789df688e99b7ca35d8fe
echoz May 6, 2012
818caed
forgotten to free up observer
echoz May 7, 2012
6f10771
Merge branch 'master' into f6222169d60127a33b7789df688e99b7ca35d8fe
echoz May 7, 2012
3bfce03
fixed bug where badge value being removed from initial uitabaritems w…
echoz May 7, 2012
5c25dc6
Merge branch 'master' into f6222169d60127a33b7789df688e99b7ca35d8fe
echoz May 7, 2012
101ada0
Some changes to PrettyTabBar stuff
vicpenap May 7, 2012
60d27e6
set item's badge value when laying out subviews.
echoz May 7, 2012
91e839d
Merge branch 'master' into f6222169d60127a33b7789df688e99b7ca35d8fe
echoz May 7, 2012
b2caddb
fixes issue where sometimes buttons don't have an image or title.
echoz May 29, 2012
b60e96b
Merge branch 'master' into f6222169d60127a33b7789df688e99b7ca35d8fe
echoz May 29, 2012
495916c
bump pretty tab bar button text up by 2 px
echoz May 30, 2012
dbc74a6
set corner radius for highlights
echoz May 30, 2012
edf7ef8
Merge branch 'master' into f6222169d60127a33b7789df688e99b7ca35d8fe
echoz May 30, 2012
2bf5bdd
work around to stop instruments complaining about a memory leak that …
echoz May 30, 2012
44d7151
ivar for BOOL prettyTabBarButtons conflicts with internal ivar
echoz Jun 29, 2012
ea27445
use ivar for accessor methods
echoz Jun 29, 2012
f9fe875
Merge branch 'master' of https://github.com/vicpenap/PrettyKit
echoz Jul 12, 2012
b24787b
Merge branch 'master' into f6222169d60127a33b7789df688e99b7ca35d8fe
echoz Jul 12, 2012
5ce670e
Merge branch 'master' of github.com:echoz/PrettyKit
echoz Jul 12, 2012
93d9c03
added ability to generate iOS 6 styled tabbars
echoz Aug 10, 2012
b110323
include the correct framework
echoz Oct 10, 2012
043fe35
Merge branch 'master' into PrettyKitOriginal
echoz Oct 10, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions PrettyExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
3F8D2269155435E40042B767 /* PrettyTabBarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F8D2268155435E40042B767 /* PrettyTabBarButton.m */; };
572B2E6615348E1B0002228B /* RotableTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 572B2E6515348E1B0002228B /* RotableTabBarController.m */; };
572B2E6A153496880002228B /* background.png in Resources */ = {isa = PBXBuildFile; fileRef = 572B2E68153496870002228B /* background.png */; };
572B2E6B153496880002228B /* background@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 572B2E69153496870002228B /* background@2x.png */; };
Expand All @@ -19,6 +20,8 @@
57360BDD14FF84F600343B7B /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 57360BDC14FF84F600343B7B /* MainWindow.xib */; };
57360BDF14FF889B00343B7B /* ExampleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 57360BDE14FF889B00343B7B /* ExampleViewController.xib */; };
57360BE114FF911200343B7B /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57360BE014FF911200343B7B /* QuartzCore.framework */; };
57810A2F1557C01E00974D07 /* listButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 57810A2D1557C01E00974D07 /* listButton.png */; };
57810A301557C01E00974D07 /* listButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 57810A2E1557C01E00974D07 /* listButton@2x.png */; };
578998C41535E02000E06FCA /* PrettyCustomViewTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 578998B31535E02000E06FCA /* PrettyCustomViewTableViewCell.m */; };
578998C51535E02000E06FCA /* PrettyGridTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 578998B51535E02000E06FCA /* PrettyGridTableViewCell.m */; };
578998C61535E02000E06FCA /* PrettySegmentedControlTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 578998B71535E02000E06FCA /* PrettySegmentedControlTableViewCell.m */; };
Expand All @@ -36,6 +39,8 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
3F8D2267155435E40042B767 /* PrettyTabBarButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrettyTabBarButton.h; sourceTree = "<group>"; };
3F8D2268155435E40042B767 /* PrettyTabBarButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrettyTabBarButton.m; sourceTree = "<group>"; };
572B2E6415348E1B0002228B /* RotableTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RotableTabBarController.h; sourceTree = "<group>"; };
572B2E6515348E1B0002228B /* RotableTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RotableTabBarController.m; sourceTree = "<group>"; };
572B2E68153496870002228B /* background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = background.png; sourceTree = "<group>"; };
Expand All @@ -53,6 +58,8 @@
57360BDC14FF84F600343B7B /* MainWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
57360BDE14FF889B00343B7B /* ExampleViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ExampleViewController.xib; sourceTree = "<group>"; };
57360BE014FF911200343B7B /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
57810A2D1557C01E00974D07 /* listButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = listButton.png; sourceTree = "<group>"; };
57810A2E1557C01E00974D07 /* listButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "listButton@2x.png"; sourceTree = "<group>"; };
578998B21535E02000E06FCA /* PrettyCustomViewTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrettyCustomViewTableViewCell.h; sourceTree = "<group>"; };
578998B31535E02000E06FCA /* PrettyCustomViewTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrettyCustomViewTableViewCell.m; sourceTree = "<group>"; };
578998B41535E02000E06FCA /* PrettyGridTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrettyGridTableViewCell.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -153,6 +160,8 @@
5735F8C214FD2FFC00DD7370 /* Supporting Files */ = {
isa = PBXGroup;
children = (
57810A2D1557C01E00974D07 /* listButton.png */,
57810A2E1557C01E00974D07 /* listButton@2x.png */,
5735F8C314FD2FFC00DD7370 /* PrettyExample-Info.plist */,
5735F8C414FD2FFC00DD7370 /* InfoPlist.strings */,
5735F8C714FD2FFC00DD7370 /* main.m */,
Expand All @@ -174,6 +183,8 @@
578998C01535E02000E06FCA /* PrettyShadowPlainTableview.m */,
578998C11535E02000E06FCA /* PrettyTabBar.h */,
578998C21535E02000E06FCA /* PrettyTabBar.m */,
3F8D2267155435E40042B767 /* PrettyTabBarButton.h */,
3F8D2268155435E40042B767 /* PrettyTabBarButton.m */,
EDA7DCAF1548EBD1002219BA /* PrettyToolbar.h */,
EDA7DCB01548EBD1002219BA /* PrettyToolbar.m */,
);
Expand Down Expand Up @@ -252,6 +263,8 @@
572B2E6A153496880002228B /* background.png in Resources */,
572B2E6B153496880002228B /* background@2x.png in Resources */,
EDA7DCB71548ED3F002219BA /* ModalViewController.xib in Resources */,
57810A2F1557C01E00974D07 /* listButton.png in Resources */,
57810A301557C01E00974D07 /* listButton@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -277,6 +290,7 @@
578998CB1535E02000E06FCA /* PrettyTabBar.m in Sources */,
EDA7DCB11548EBD1002219BA /* PrettyToolbar.m in Sources */,
EDA7DCB61548ED3F002219BA /* ModalViewController.m in Sources */,
3F8D2269155435E40042B767 /* PrettyTabBarButton.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
3 changes: 2 additions & 1 deletion PrettyExample/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "AppDelegate.h"
#import "ExampleViewController.h"
#import "PrettyTabBar.h"

@implementation AppDelegate

Expand All @@ -29,7 +30,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
self.window.backgroundColor = [UIColor whiteColor];

self.window.rootViewController = self.tabBarController;

((PrettyTabBar *)self.tabBarController.tabBar).prettyTabBarButtons = YES;

[self.window makeKeyAndVisible];
return YES;
Expand Down
10 changes: 9 additions & 1 deletion PrettyExample/MainWindow.xib
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
<object class="IBUINavigationController" key="IBUISelectedViewController" id="635481500">
<object class="IBUITabBarItem" key="IBUITabBarItem" id="303198971">
<string key="IBUITitle">Plain Table</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">listButton.png</string>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIParentViewController" ref="416037990"/>
Expand Down Expand Up @@ -303,7 +307,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">24</int>
<int key="maxID">25</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
Expand All @@ -314,6 +318,10 @@
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="NS.key.0">listButton.png</string>
<string key="NS.object.0">{22, 16}</string>
</object>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
Binary file added PrettyExample/listButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added PrettyExample/listButton@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 34 additions & 1 deletion PrettyKit/PrettyDrawing.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// SOFTWARE.


#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef enum {
LinePositionTop = 0,
Expand All @@ -40,6 +40,26 @@ typedef enum {

@interface PrettyDrawing : NSObject

/**
Returns a CGMutablePathRef that is for a Rounded Rectangle in rect with corner radii radius.
*/
CGMutablePathRef PrettyKitCreateMutablePathForRoundedRect(CGRect rect, CGFloat radius);

/**
Draws a rounded rectangle using the radius and fill color into a rect
*/
+ (void)drawRoundedRect:(CGRect)rect cornerRadius:(CGFloat)radius color:(UIColor *)color;

/**
Draws a gradient into a context using a startPoint, endPOint and a from and to color
*/
+ (void)drawGradientForContext:(CGContextRef)context startPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint fromColor:(UIColor *)fromColor toColor:(UIColor *)toColor;

/**
Draws a rounded rect with a gradient and a corner radius into a rect
*/
+ (void)drawGradientRoundedRect:(CGRect)rect cornerRadius:(CGFloat)radius fromColor:(UIColor *)from toColor:(UIColor *)to;

/**
Draws a gradient with the given colors into the given rect.
*/
Expand Down Expand Up @@ -79,6 +99,12 @@ typedef enum {
*/
- (void) dropShadowWithOpacity:(float)opacity;

/** Drops a shadow with the given opacity and offset.

@warning This method uses the UILayer shadow properties.
*/
- (void) dropShadowOffset:(CGSize)offset withOpacity:(float)opacity;

@end


Expand All @@ -92,4 +118,11 @@ typedef enum {
@return A new autoreleased UIColor instance. */
+ (UIColor *) colorWithHex:(int)hex;

/** Converts the color to an RGB colorspace and puts values of the components into the components parameter

@param Pointer to a CGFloat array of the most 4 elements

*/
-(void)getRGBColorComponents:(CGFloat [4])components;

@end
126 changes: 110 additions & 16 deletions PrettyKit/PrettyDrawing.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,85 @@

@implementation PrettyDrawing

+ (void) drawGradient:(CGRect)rect fromColor:(UIColor *)from toColor:(UIColor *)to {
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSaveGState(ctx);
CGMutablePathRef PrettyKitCreateMutablePathForRoundedRect(CGRect rect, CGFloat radius) {
CGMutablePathRef path = CGPathCreateMutable();
CGPathAddArc(path, NULL, rect.origin.x + radius, rect.origin.y + radius, radius, (180) * M_PI/180, (-90) * M_PI/180, 0);
CGPathAddArc(path, NULL, rect.origin.x + rect.size.width - radius, rect.origin.y + radius, radius, (-90) * M_PI/180, (0) * M_PI/180, 0);
CGPathAddArc(path, NULL, rect.origin.x + rect.size.width - radius, rect.origin.y + rect.size.height - radius, radius, (0) * M_PI/180, (-270) * M_PI/180, 0);
CGPathAddArc(path, NULL, rect.origin.x + radius, rect.origin.y + rect.size.height - radius, radius, (-270) * M_PI/180, (-180) * M_PI/180, 0);

return path;
}

+ (void)drawRoundedRect:(CGRect)rect cornerRadius:(CGFloat)radius color:(UIColor *)color {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);

CGContextAddRect(ctx, rect);
CGContextClip(ctx);
CGMutablePathRef path = PrettyKitCreateMutablePathForRoundedRect(rect, radius);
CGContextAddPath(context, path);

[color setFill];
CGContextDrawPath(context, kCGPathFill);

CGContextRestoreGState(context);
CGPathRelease(path);
}

+ (void)drawGradientRoundedRect:(CGRect)rect cornerRadius:(CGFloat)radius fromColor:(UIColor *)from toColor:(UIColor *)to {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);

CGMutablePathRef path = PrettyKitCreateMutablePathForRoundedRect(rect, radius);
CGContextAddPath(context, path);
CGContextClip(context);

[PrettyDrawing drawGradientForContext:context
startPoint:CGPointMake(rect.origin.x + rect.size.width/2, rect.origin.y)
endPoint:CGPointMake(rect.origin.x + rect.size.width/2, rect.origin.y + rect.size.height)
fromColor:from
toColor:to];

CGContextRestoreGState(context);
CGPathRelease(path);

}

+ (void)drawGradientForContext:(CGContextRef)context startPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint fromColor:(UIColor *)fromColor toColor:(UIColor *)toColor {
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGFloat locations[] = { 0.0, 1.0 };

CGColorRef startColor = from.CGColor;
CGColorRef endColor = to.CGColor;
NSArray *colors = [NSArray arrayWithObjects:(id)startColor, (id)endColor, nil];
CGFloat locations[] = {0.0, 1.0};

CGGradientRef gradient = CGGradientCreateWithColors(colorSpace,
(CFArrayRef) colors, locations);
// iOS 4.3 safe way of drawing gradients. not as awesome as CGGradientCreateWithColors
CGFloat fromComponents[4];
[fromColor getRGBColorComponents:fromComponents];

CGPoint startPoint = CGPointMake(CGRectGetMidX(rect), CGRectGetMinY(rect));
CGPoint endPoint = CGPointMake(CGRectGetMidX(rect), CGRectGetMaxY(rect));
CGFloat toComponents[4];
[toColor getRGBColorComponents:toComponents];

CGContextDrawLinearGradient(ctx, gradient, startPoint, endPoint, 0);
CGFloat colors[8] = { fromComponents[0], fromComponents[1], fromComponents[2], fromComponents[3],
toComponents[0], toComponents[1], toComponents[2], toComponents[3]};

CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, 2);

/////////////////////////////////////////////////////////////////////////

CGContextDrawLinearGradient(context, gradient, startPoint, endPoint, 0);
CGGradientRelease(gradient);
CGColorSpaceRelease(colorSpace);
}

+ (void) drawGradient:(CGRect)rect fromColor:(UIColor *)from toColor:(UIColor *)to {
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSaveGState(ctx);

CGContextAddRect(ctx, rect);
CGContextClip(ctx);

CGPoint startPoint = CGPointMake(CGRectGetMidX(rect), CGRectGetMinY(rect));
CGPoint endPoint = CGPointMake(CGRectGetMidX(rect), CGRectGetMaxY(rect));

[PrettyDrawing drawGradientForContext:ctx startPoint:startPoint endPoint:endPoint fromColor:from toColor:to];

CGContextRestoreGState(ctx);
}

Expand Down Expand Up @@ -118,13 +173,19 @@ + (void) drawGradient:(CGGradientRef)gradient rect:(CGRect)rect

@implementation UIView (PrettyKit)

- (void) dropShadowWithOpacity:(float)opacity {
- (void) dropShadowOffset:(CGSize)offset withOpacity:(float)opacity {
self.layer.masksToBounds = NO;
self.layer.shadowOffset = CGSizeMake(0, 0);
self.layer.shadowOffset = offset;
self.layer.shadowOpacity = opacity;
self.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.bounds].CGPath;
}

- (void) dropShadowWithOpacity:(float)opacity {
[self dropShadowOffset:CGSizeMake(0, 0) withOpacity:opacity];

}


@end


Expand All @@ -137,5 +198,38 @@ + (UIColor *) colorWithHex:(int)hex {
blue:((float)(hex & 0xFF))/255.0 alpha:1.0];
}

-(void)getRGBColorComponents:(CGFloat [4])components {
if (CGColorGetNumberOfComponents([self CGColor]) == 4) {
const CGFloat *actualComponents = CGColorGetComponents([self CGColor]);

components[0] = actualComponents[0];
components[1] = actualComponents[1];
components[2] = actualComponents[2];
components[3] = actualComponents[3];

return;
}

components[3] = CGColorGetAlpha([self CGColor]);

CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB();
unsigned char resultingPixel[4];
CGContextRef context = CGBitmapContextCreate(&resultingPixel,
1,
1,
8,
4,
rgbColorSpace,
kCGImageAlphaNoneSkipLast);
CGContextSetFillColorWithColor(context, [self CGColor]);
CGContextFillRect(context, CGRectMake(0, 0, 1, 1));
CGContextRelease(context);
CGColorSpaceRelease(rgbColorSpace);

for (int component = 0; component < 3; component++) {
components[component] = resultingPixel[component] / 255.0f;
}
}


@end
2 changes: 1 addition & 1 deletion PrettyKit/PrettyNavigationBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ @implementation PrettyNavigationBar
@synthesize shadowOpacity, gradientEndColor, gradientStartColor, topLineColor, bottomLineColor, roundedCornerRadius, roundedCornerColor;


#define default_shadow_opacity 0.5
#define default_shadow_opacity 0.5
#define default_gradient_end_color [UIColor colorWithHex:0x297CB7]
#define default_gradient_start_color [UIColor colorWithHex:0x53A4DE]
#define default_top_line_color [UIColor colorWithHex:0x84B7D5]
Expand Down
Loading