Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

extracted some color constants

  • Loading branch information...
commit 13f465a692fd909643abd186a6456204f46bd40e 1 parent 413fa78
@grillp grillp authored
Showing with 13 additions and 6 deletions.
  1. +13 −6 TechRadarMobile/src/TWQuadrantButton.m
View
19 TechRadarMobile/src/TWQuadrantButton.m
@@ -10,11 +10,16 @@
#import "TWSectionLabel.h"
#import "Section.h"
+#define COLOR_BLUE [UIColor colorWithRed:0.1860 green:0.6287 blue:0.8087 alpha:1]
+
@implementation TWQuadrantButton
{
UIColor *_defaultBackgroundColor;
NSMutableArray* _sectionLabels;
CGFloat _totalSectionWeight;
+ UIColor* colorText;
+ UIColor* colorIcon;
+ UIColor*_colorTitle;
}
@synthesize quadrant = _quadrant;
@@ -24,12 +29,17 @@ - (id)initWithQuadrant:(Quadrant *)quadrant;
{
if ((self = [super initWithFrame:CGRectZero]))
{
+ colorText = COLOR_BLUE;
+ colorIcon = COLOR_BLUE;
+ _colorTitle = [UIColor whiteColor];
+
self.quadrant = quadrant;
self.backgroundColor = [UIColor whiteColor];
UILabel *title = [[UILabel alloc] initWithFrame:CGRectZero];
title.text = quadrant.name;
title.backgroundColor = [UIColor clearColor];
+ title.textColor = _colorTitle;
// cause the text field to size itself to fit the label
[title sizeToFit];
@@ -71,7 +81,7 @@ - (void)addSectionLabels;
TWSectionLabel *sectionLabel = [[TWSectionLabel alloc]initWithFrame:CGRectNull section:section];
sectionLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size: 15.0];
- sectionLabel.color = [UIColor whiteColor];
+ sectionLabel.color = COLOR_BLUE;
sectionLabel.backgroundColor = [UIColor clearColor];
sectionLabel.hidden = YES;
sectionLabel.startAngle = angle * M_PI / 180.0;
@@ -273,7 +283,6 @@ - (void)drawIcons:(CGContextRef)context bounds:(CGRect)rect;
// CGContextConcatCTM(context, transform);
- [self drawIcon:context at:CGPointMake(50,50) transform:transform layer:technologyStateSameIconLayer];
[self drawIcon:context at:CGPointMake(50, 50) transform:transform layer:technologyStateSameIconLayer];
[self drawIcon:context at:CGPointMake(25, 50) transform:transform layer:technologyStateSameIconLayer];
[self drawIcon:context at:CGPointMake(25, 25) transform:transform layer:technologyStateSameIconLayer];
@@ -317,8 +326,6 @@ - (void)drawCrossHairs:(CGContextRef)context;
- (void)drawBackground:(CGContextRef)context bounds:(CGRect)bounds;
{
-
-
CGFloat startColor = (_quadrant.position & TWQuadrantTop ? TOP_GRAYLEVEL : CENTER_GRAY_LEVEL);
CGFloat endColor = (_quadrant.position & TWQuadrantTop ? CENTER_GRAY_LEVEL : BOTTOM_GRAY_LEVEL);
@@ -338,8 +345,6 @@ - (void)drawBackground:(CGContextRef)context bounds:(CGRect)bounds;
}
-// ==================================
-
- (CGLayerRef) createTechnologyStateSameIconLayer:(CGContextRef)context bounds:(CGRect)rect scale:(CGSize)scale;
{
CGLayerRef layer = CGLayerCreateWithContext (context, rect.size, NULL);
@@ -350,6 +355,8 @@ - (CGLayerRef) createTechnologyStateSameIconLayer:(CGContextRef)context bounds:(
CGContextAddArc(layerContext, 0.5, 0.5, 0.5, 0., 2*M_PI, 0.);
CGContextSetRGBFillColor(layerContext, 0.1860, 0.6287, 0.8087, 1);
+ CGContextSetFillColorWithColor(layerContext, colorIcon.CGColor);
+
CGContextFillPath(layerContext);
return layer;
}
Please sign in to comment.
Something went wrong with that request. Please try again.