Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickl committed Apr 15, 2017
1 parent 8ab0845 commit 6ad45a4
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## [Version 3.3]()

- [ADD] Support alpha channel with the hex strings (e.g. #FF0934CC)

## [Version 3.2.1](https://github.com/yannickl/DynamicColor/releases/tag/3.2.1)
*Released on 2016-12-15.*

Expand Down
2 changes: 1 addition & 1 deletion DynamicColor.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'DynamicColor'
s.version = '3.2.1'
s.version = '3.3'
s.license = 'MIT'
s.summary = 'Yet another extension to manipulate colors easily in Swift (UIColor and NSColor)'
s.homepage = 'https://github.com/yannickl/DynamicColor.git'
Expand Down
2 changes: 1 addition & 1 deletion Examples/DynamicColor/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.2.1</string>
<string>3.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
3 changes: 3 additions & 0 deletions Examples/DynamicColorExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,7 @@
CE86888E1E2C163400207CAC /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
CE8688AC1E2C1AB300207CAC /* Build configuration list for PBXNativeTarget "DynamicColorTvOs" */ = {
isa = XCConfigurationList;
Expand All @@ -1527,6 +1528,7 @@
CE8688AE1E2C1AB300207CAC /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
CE8688C81E2C1B3000207CAC /* Build configuration list for PBXNativeTarget "DynamicColorWatchOs" */ = {
isa = XCConfigurationList;
Expand All @@ -1535,6 +1537,7 @@
CE8688CA1E2C1B3000207CAC /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
CEA4D1371D95642900B12DAB /* Build configuration list for PBXNativeTarget "iOSTests" */ = {
isa = XCConfigurationList;
Expand Down
2 changes: 1 addition & 1 deletion Examples/DynamicColorMacOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.2.1</string>
<string>3.3</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion Examples/DynamicColorTvOs/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.2.1</string>
<string>3.3</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion Examples/DynamicColorWatchOs/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.2.1</string>
<string>3.3</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion Examples/iOSExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.2.1</string>
<string>3.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Examples/tvOSExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.2.1</string>
<string>3.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

use_frameworks!
pod 'DynamicColor', '~> 3.2.1'
pod 'DynamicColor', '~> 3.3'
```

Install into your project:
Expand Down Expand Up @@ -266,7 +266,7 @@ $ brew install carthage
To integrate `DynamicColor` into your Xcode project using Carthage, specify it in your `Cartfile` file:

```ogdl
github "yannickl/DynamicColor" >= 3.2.1
github "yannickl/DynamicColor" >= 3.3
```

#### Swift Package Manager
Expand All @@ -278,7 +278,7 @@ let package = Package(
name: "YOUR_PROJECT_NAME",
targets: [],
dependencies: [
.Package(url: "https://github.com/yannickl/DynamicColor.git", versions: "3.2.1" ..< Version.max)
.Package(url: "https://github.com/yannickl/DynamicColor.git", versions: "3.3" ..< Version.max)
]
)
```
Expand Down
13 changes: 7 additions & 6 deletions Sources/DynamicColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public extension DynamicColor {
var color: UInt32 = 0

if scanner.scanHexInt32(&color) {
self.init(hex: color, withAlphaChannel: hexString.characters.count > 7)
self.init(hex: color, useAlpha: hexString.characters.count > 7)
}
else {
self.init(hex: 0x000000)
Expand All @@ -76,14 +76,15 @@ public extension DynamicColor {
Creates a color from an hex integer (e.g. 0x3498db).
- parameter hex: A hexa-decimal UInt32 that represents a color.
- parameter alphaChannel: If true the given hex-decimal UInt32 includes the alpha channel (e.g. 0xFF0000FF).
*/
public convenience init(hex: UInt32, withAlphaChannel: Bool = false) {
public convenience init(hex: UInt32, useAlpha alphaChannel: Bool = false) {
let mask = 0xFF

let r = Int(hex >> (withAlphaChannel ? 24 : 16)) & mask
let g = Int(hex >> (withAlphaChannel ? 16 : 8)) & mask
let b = Int(hex >> (withAlphaChannel ? 8 : 0)) & mask
let a = withAlphaChannel ? Int(hex) & mask : 255
let r = Int(hex >> (alphaChannel ? 24 : 16)) & mask
let g = Int(hex >> (alphaChannel ? 16 : 8)) & mask
let b = Int(hex >> (alphaChannel ? 8 : 0)) & mask
let a = alphaChannel ? Int(hex) & mask : 255

let red = CGFloat(r) / 255
let green = CGFloat(g) / 255
Expand Down

0 comments on commit 6ad45a4

Please sign in to comment.