Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (21 sloc) 0.677 kb
//
// UIColor+DCTMixing.m
// Tweetopolis
//
// Created by Daniel Tull on 12.03.2012.
// Copyright (c) 2012 Daniel Tull. All rights reserved.
//
#import "UIColor+DCTMixing.h"
@implementation UIColor (DCTMixing)
- (UIColor *)dct_colorWithAlpha:(CGFloat)alpha {
CGColorRef selfColorRef = self.CGColor;
const CGFloat *components = CGColorGetComponents(selfColorRef);
int selfNumberOfComponents = CGColorGetNumberOfComponents(selfColorRef);
if (selfNumberOfComponents == 2)
return [UIColor colorWithWhite:components[0] alpha:alpha];
return [UIColor colorWithRed:components[0]
green:components[1]
blue:components[2]
alpha:alpha];
}
@end
Jump to Line
Something went wrong with that request. Please try again.