Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Commit

Permalink
Release 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vicc committed Jan 25, 2016
1 parent d331021 commit bb5ea8f
Show file tree
Hide file tree
Showing 48 changed files with 52 additions and 250 deletions.
Empty file modified CHANGELOG.md 100644 → 100755
Empty file.
182 changes: 0 additions & 182 deletions Chameleon.xcodeproj/project.pbxproj 100644 → 100755

Large diffs are not rendered by default.

Empty file.
Empty file modified Chameleon.xcodeproj/xcshareddata/xcschemes/Chameleon.xcscheme 100644 → 100755
Empty file.
Empty file modified Chameleon/Chameleon.h 100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion Chameleon/Info.plist 100644 → 100755
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>2.0.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
Empty file modified ChameleonDemo-ObjC/AppDelegate.h 100644 → 100755
Empty file.
4 changes: 1 addition & 3 deletions ChameleonDemo-ObjC/AppDelegate.m 100644 → 100755
Expand Up @@ -18,9 +18,7 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

//Set global theme
//[Chameleon setGlobalThemeUsingPrimaryColor:FlatMint withSecondaryColor:FlatBlue andContentStyle:UIContentStyleContrast];

[Chameleon setGlobalThemeUsingPrimaryColor:FlatMint withContentStyle:UIContentStyleContrast];
[Chameleon setGlobalThemeUsingPrimaryColor:FlatMint withSecondaryColor:FlatBlue andContentStyle:UIContentStyleContrast];


return YES;
Expand Down
Empty file.
Empty file modified ChameleonDemo-ObjC/Base.lproj/LaunchScreen.storyboard 100644 → 100755
Empty file.
Empty file modified ChameleonDemo-ObjC/Base.lproj/Main.storyboard 100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion ChameleonDemo-ObjC/Info.plist 100644 → 100755
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>2.0.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
Empty file modified ChameleonDemo-ObjC/ViewController.h 100644 → 100755
Empty file.
Empty file modified ChameleonDemo-ObjC/ViewController.m 100644 → 100755
Empty file.
Empty file modified ChameleonDemo-ObjC/main.m 100644 → 100755
Empty file.
Empty file modified ChameleonDemo/AppDelegate.swift 100644 → 100755
Empty file.
Empty file modified ChameleonDemo/Assets.xcassets/AppIcon.appiconset/Contents.json 100644 → 100755
Empty file.
Empty file modified ChameleonDemo/Base.lproj/LaunchScreen.storyboard 100644 → 100755
Empty file.
20 changes: 11 additions & 9 deletions ChameleonDemo/Base.lproj/Main.storyboard 100644 → 100755
@@ -1,18 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<<<<<<< HEAD
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Xln-K6-UFC">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
=======
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Xln-K6-UFC">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
>>>>>>> origin/master
</dependencies>
<scenes>
<!--Title Goes Here-->
<!--Title goes Here-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="ChameleonDemo" customModuleProvider="target" sceneMemberID="viewController">
Expand All @@ -26,34 +19,42 @@
<subviews>
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="100" translatesAutoresizingMaskIntoConstraints="NO" id="19T-Ed-0Qn">
<rect key="frame" x="35" y="89" width="94" height="29"/>
<animations/>
</stepper>
<pageControl opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" numberOfPages="5" translatesAutoresizingMaskIntoConstraints="NO" id="itF-AN-yqB">
<rect key="frame" x="137" y="85" width="90" height="37"/>
<animations/>
</pageControl>
<progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" fixedFrame="YES" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="poA-HK-aBg">
<rect key="frame" x="35" y="205" width="150" height="2"/>
<animations/>
</progressView>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lWe-yR-1HQ">
<rect key="frame" x="178" y="141" width="51" height="31"/>
<animations/>
</switch>
<slider opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="ebB-OC-Xdd">
<rect key="frame" x="33" y="240" width="118" height="31"/>
<animations/>
</slider>
<segmentedControl opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="7Gc-EA-0wb">
<rect key="frame" x="35" y="143" width="121" height="29"/>
<animations/>
<segments>
<segment title="First"/>
<segment title="Second"/>
</segments>
</segmentedControl>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wA2-Zr-ic0">
<rect key="frame" x="181" y="240" width="46" height="30"/>
<animations/>
<state key="normal" title="Button"/>
</button>
</subviews>
<animations/>
<color key="backgroundColor" red="0.80000000000000004" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</view>
<navigationItem key="navigationItem" title="Title Goes Here" id="4Do-bz-Jkp"/>
<navigationItem key="navigationItem" title="Title goes Here" id="4Do-bz-Jkp"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
Expand All @@ -67,6 +68,7 @@
<navigationBar key="navigationBar" contentMode="scaleToFill" id="ppb-Cb-Vaf">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
<color key="barTintColor" red="0.96799742229999997" green="0.3209621513" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</navigationBar>
<nil name="viewControllers"/>
Expand Down
2 changes: 1 addition & 1 deletion ChameleonDemo/Info.plist 100644 → 100755
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<string>2.0.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
Empty file modified ChameleonDemo/ViewController.swift 100644 → 100755
Empty file.
4 changes: 0 additions & 4 deletions ChameleonFramework.podspec
@@ -1,10 +1,6 @@
Pod::Spec.new do |s|
s.name = "ChameleonFramework"
<<<<<<< HEAD
s.version = "2.1.0"
=======
s.version = "2.0.5"
>>>>>>> origin/master
s.summary = "Color Framework for iOS (Obj-C & Swift)"
s.homepage = "https://github.com/ViccAlexander/Chameleon"
s.screenshots = "https://camo.githubusercontent.com/bde5aa6ee0e1feec044d184a735da8024c60c04c/687474703a2f2f692e696d6775722e636f6d2f427771486842342e706e67"
Expand Down
Empty file modified Pod/Classes/Objective-C/Chameleon.h 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/ChameleonConstants.h 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/ChameleonConstants.m 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/ChameleonEnums.h 100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions Pod/Classes/Objective-C/ChameleonMacros.h
Expand Up @@ -99,8 +99,6 @@
#define AverageColorFromImage(image) [UIColor colorWithAverageColorFromImage:image]
#define AverageColorFromImageWithAlpha(image, alpha) [UIColor colorWithAverageColorFromImage:image withAlpha:alpha]

#define RandomFlatColorInArray(colors) [UIColor colorWithRandomColorInArray:colors]
#define RandomFlatColorExcluding(colors) [UIColor colorWithRandomFlatColorExcludingColorsInArray:colors];
#define RandomFlatColorWithShade(shade) [UIColor colorWithRandomFlatColorOfShadeStyle:shade]
#define RandomFlatColorWithShadeAndAlpha(shade, alpha) [UIColor colorWithRandomFlatColorOfShadeStyle:shade withAlpha:alpha]

Expand All @@ -115,6 +113,8 @@
#define HexColor(hexString) [UIColor colorWithHexString:hexString]
#define HexColorWithAlpha(hexString, alpha) [UIColor colorWithHexString:hexString withAlpha:alpha]

#define RandomFlatColorInArray(colors) [UIColor colorWithRandomColorInArray:colors]
#define RandomFlatColorExcluding(colors) [UIColor colorWithRandomFlatColorExcludingColorsInArray:colors];
#define RandomFlatColorWithShade(shade) [UIColor colorWithRandomFlatColorOfShadeStyle:shade]
#define RandomFlatColorWithShadeAndAlpha(shade, alpha) [UIColor colorWithRandomFlatColorOfShadeStyle:shade withAlpha:alpha]

Expand Down
Empty file modified Pod/Classes/Objective-C/Chameleon_.h 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/Chameleon_.m 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UIAppearance+Swift.h 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UIAppearance+Swift.m 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UIButton+Chameleon.h 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UIButton+Chameleon.m 100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions Pod/Classes/Objective-C/UIColor+Chameleon.h
Expand Up @@ -623,7 +623,7 @@ typedef NS_ENUM (NSInteger, UIShadeStyle) {
*/
+ (UIColor *)colorWithHexString:(NSString *)string withAlpha:(CGFloat)alpha;

#pragma mark - Other Cool Methods
#pragma mark - Instance Methods

/**
* Creates and returns a flat color object closest to the specified color in the LAB colorspace.
Expand All @@ -648,13 +648,13 @@ typedef NS_ENUM (NSInteger, UIShadeStyle) {
/**
* @author Vicc Alexander
*
* Returns the hexidecimal string value for the specified color.
* Returns the hex string value for the specified color.
*
* @return An @NSString object.
*
* @since 2.1.0
*/
- (NSString *)hexStringValue;
- (NSString *)hexValue;

/**
* Creates and returns a lighter shade of a specified color in the HSB space.
Expand Down
40 changes: 17 additions & 23 deletions Pod/Classes/Objective-C/UIColor+Chameleon.m
Expand Up @@ -499,7 +499,7 @@ + (UIColor *)colorWithGradientStyle:(UIGradientStyle)gradientStyle withFrame:(CG
[backgroundGradientLayer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *backgroundColorImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

[self setGradientImage:backgroundColorImage];
return [UIColor colorWithPatternImage:backgroundColorImage];
}
Expand All @@ -509,15 +509,15 @@ + (UIColor *)colorWithGradientStyle:(UIGradientStyle)gradientStyle withFrame:(CG

//Specific the spread of the gradient (For now this gradient only takes 2 locations)
CGFloat locations[2] = {0.0, 1.0};

//Default to the RGB Colorspace
CGColorSpaceRef myColorspace = CGColorSpaceCreateDeviceRGB();
CFArrayRef arrayRef = (__bridge CFArrayRef)cgColors;

//Create our Fradient
CGGradientRef myGradient = CGGradientCreateWithColors(myColorspace, arrayRef, locations);


// Normalise the 0-1 ranged inputs to the width of the image
CGPoint myCentrePoint = CGPointMake(0.5 * frame.size.width, 0.5 * frame.size.height);
float myRadius = MIN(frame.size.width, frame.size.height) * 1.0;
Expand Down Expand Up @@ -565,7 +565,7 @@ + (UIColor *)colorWithHexString:(NSString *)string {
}

+ (UIColor *)colorWithHexString:(NSString *)string withAlpha:(CGFloat)alpha {

//Quick return in case string is empty
if (string.length == 0) {
return nil;
Expand All @@ -579,9 +579,9 @@ + (UIColor *)colorWithHexString:(NSString *)string withAlpha:(CGFloat)alpha {
//Make sure we have a working string length
if (string.length != 7 && string.length != 4) {

#ifdef DEBUG
#ifdef DEBUG
NSLog(@"Unsupported string format: %@", string);
#endif
#endif

return nil;
}
Expand All @@ -591,9 +591,9 @@ + (UIColor *)colorWithHexString:(NSString *)string withAlpha:(CGFloat)alpha {

//Convert to full length hex string
string = [NSString stringWithFormat:@"#%@%@%@%@%@%@",
[string substringWithRange:NSMakeRange(1, 1)],[string substringWithRange:NSMakeRange(1, 1)],
[string substringWithRange:NSMakeRange(2, 1)],[string substringWithRange:NSMakeRange(2, 1)],
[string substringWithRange:NSMakeRange(3, 1)],[string substringWithRange:NSMakeRange(3, 1)]];
[string substringWithRange:NSMakeRange(1, 1)],[string substringWithRange:NSMakeRange(1, 1)],
[string substringWithRange:NSMakeRange(2, 1)],[string substringWithRange:NSMakeRange(2, 1)],
[string substringWithRange:NSMakeRange(3, 1)],[string substringWithRange:NSMakeRange(3, 1)]];
}

NSString *redHex = [NSString stringWithFormat:@"0x%@", [string substringWithRange:NSMakeRange(1, 2)]];
Expand Down Expand Up @@ -657,7 +657,6 @@ + (UIColor *)randomFlatColor {
}

return [self flatColors][randomColorChosen];
<<<<<<< HEAD
}

+ (UIColor *)colorWithRandomColorInArray:(NSArray *)colors {
Expand Down Expand Up @@ -693,8 +692,6 @@ + (UIColor *)colorWithRandomFlatColorExcludingColorsInArray:(NSArray *)colors {

//Return
return randomColor;
=======
>>>>>>> origin/master
}

+ (UIColor *)colorWithRandomFlatColorOfShadeStyle:(UIShadeStyle)shadeStyle {
Expand Down Expand Up @@ -745,7 +742,7 @@ + (UIColor *)colorWithRandomFlatColorOfShadeStyle:(UIShadeStyle)shadeStyle withA

case UIShadeStyleLight:
default: {

NSArray *lightColors = @[FlatBlack, FlatBlue, FlatBrown, FlatCoffee, FlatForestGreen, FlatGray, FlatGreen, FlatLime, FlatMagenta, FlatMaroon, FlatMint, FlatNavyBlue, FlatOrange, FlatPink, FlatPlum, FlatPowderBlue, FlatPurple, FlatRed, FlatSand, FlatSkyBlue, FlatTeal, FlatWatermelon, FlatWhite, FlatYellow];

randomColor = lightColors[randomColorChosen];
Expand Down Expand Up @@ -786,7 +783,7 @@ - (UIColor *)darkenByPercentage:(CGFloat)percentage {
return nil;
}

- (NSString *)hexStringValue {
- (NSString *)hexValue {

UIColor *currentColor = self;
if (CGColorGetNumberOfComponents(self.CGColor) < 4) {
Expand All @@ -799,6 +796,7 @@ - (NSString *)hexStringValue {
}

return [NSString stringWithFormat:@"#%02X%02X%02X", (int)((CGColorGetComponents(currentColor.CGColor))[0]*255.0), (int)((CGColorGetComponents(currentColor.CGColor))[1]*255.0), (int)((CGColorGetComponents(currentColor.CGColor))[2]*255.0)];

}

- (UIColor *)lightenByPercentage:(CGFloat)percentage {
Expand All @@ -811,7 +809,7 @@ - (UIColor *)lightenByPercentage:(CGFloat)percentage {

//Make sure our percentage is greater than 0
if (percentage > 0) {
b = MIN(b + percentage, 1.0);
b = MIN(b + percentage, 1.0);
}

//Return lighter color
Expand Down Expand Up @@ -883,9 +881,9 @@ - (void)getRGBAComponents:(CGFloat[4])rgba {
case kCGColorSpaceModelPattern:
case kCGColorSpaceModelUnknown: {

#ifdef DEBUG
#ifdef DEBUG
NSLog(@"Unsupported color model: %i", model);
#endif
#endif

rgba[0] = 0.0f;
rgba[1] = 0.0f;
Expand All @@ -908,7 +906,7 @@ - (BOOL)isMonochromeOrRGB {
//More info: http://en.wikipedia.org/wiki/Color_difference
+ (float)totalSumOfDifferencesFroml1:(CGFloat)L1 l2:(CGFloat)L2 a1:(CGFloat)A1
a2:(CGFloat)A2 b1:(CGFloat)B1 b2:(CGFloat)B2 {

//Get C Values in LCH from LAB Values
CGFloat C1 = sqrt(pow(A1, 2) + pow(B1, 2));
CGFloat C2 = sqrt(pow(A2, 2) + pow(B2, 2));
Expand Down Expand Up @@ -1016,16 +1014,12 @@ + (UIColor *)nearestFlatColorForL:(CGFloat)l1 A:(CGFloat)a1 B:(CGFloat)b1 alpha:
}
}
}


//Collect the RGB Values of the color where the smallest difference was found
CGFloat red, green, blue;
[[self flatColors][index] getRed:&red green:&green blue:&blue alpha:nil];
<<<<<<< HEAD

=======

>>>>>>> origin/master
//Return the closest flat color
return rgba(red * 255, green * 255, blue * 255, alpha);
}
Expand Down
Empty file modified Pod/Classes/Objective-C/UIColor+ChameleonPrivate.h 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UIColor+ChameleonPrivate.m 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UIImage+ChameleonPrivate.h 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UIImage+ChameleonPrivate.m 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UILabel+Chameleon.h 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UILabel+Chameleon.m 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UINavigationController+Chameleon.h 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UINavigationController+Chameleon.m 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UIView+ChameleonPrivate.h 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UIView+ChameleonPrivate.m 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UIViewController+Chameleon.h 100644 → 100755
Empty file.
Empty file modified Pod/Classes/Objective-C/UIViewController+Chameleon.m 100644 → 100755
Empty file.

0 comments on commit bb5ea8f

Please sign in to comment.