Skip to content

Commit

Permalink
Merge branch 'release/0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrs1885 committed Apr 26, 2019
2 parents a352cf6 + b619faf commit f0deb93
Show file tree
Hide file tree
Showing 34 changed files with 806 additions and 51 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Version 0.3.0
### Features
* Grayscale support

## Version 0.2.0
### Features
* HSB support
Expand Down
4 changes: 4 additions & 0 deletions Documentation/Reference/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Reference Documentation
This Reference Documentation has been generated with
[SourceDocs](https://github.com/eneko/SourceDocs).

## Protocols

Expand All @@ -11,6 +13,7 @@

## Classes

- [GrayscaleColor](classes/GrayscaleColor.md)
- [HSBAColor](classes/HSBAColor.md)
- [RGBAColor](classes/RGBAColor.md)

Expand All @@ -20,6 +23,7 @@

## Extensions

- [GrayscaleColor](extensions/GrayscaleColor.md)
- [HSBAColor](extensions/HSBAColor.md)
- [RGBAColor](extensions/RGBAColor.md)
- [SheetyColorsController](extensions/SheetyColorsController.md)
Expand Down
50 changes: 50 additions & 0 deletions Documentation/Reference/classes/GrayscaleColor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
**CLASS**

# `GrayscaleColor`

```swift
public class GrayscaleColor: NSObject, NSCopying, Codable
```

> A model class representing grayscale colors. The white component can hold values between 0.0 and 255.0 while the alphavalue has a maximum value of 100.0.

## Methods
### `init(white:alpha:)`

```swift
public init(white: CGFloat, alpha: CGFloat)
```

> Creates a GrayscaleColor instance.
>
> - Parameter:
> - white: The white component.
> - alpha: The opacity component.

### `copy(with:)`

```swift
public func copy(with _: NSZone? = nil) -> Any
```

> Creates a copy of the GrayscaleColor instance.
>
> - Returns: A copy of the GrayscaleColor instance.

### `isEqual(_:)`

```swift
public override func isEqual(_ object: Any?) -> Bool
```

> Compares two GrayscaleColor instances with each other.
>
> - Parameter object: The GrayscaleColor to compare with.
>
> - Returns: 'true' if the instance is equal to the other GrayscaleColor instance, otherwise 'false''.

#### Parameters

| Name | Description |
| ---- | ----------- |
| object | The GrayscaleColor to compare with. |
14 changes: 11 additions & 3 deletions Documentation/Reference/enums/SheetyColorsType.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ public enum SheetyColorsType: Equatable, CaseIterable
> An enum used for specifying the color model of the SheetyColors view.

## Cases
### `rgb`
### `grayscale`

```swift
case rgb
case grayscale
```

> The RGB color model.
> The grayscale color model.

### `hsb`

Expand All @@ -24,3 +24,11 @@ case hsb
```

> The HSB color model.

### `rgb`

```swift
case rgb
```

> The RGB color model.
12 changes: 12 additions & 0 deletions Documentation/Reference/extensions/GrayscaleColor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**EXTENSION**

# `GrayscaleColor`

## Properties
### `uiColor`

```swift
public var uiColor: UIColor
```

> The UIColor representation of the GrayscaleColor.
8 changes: 8 additions & 0 deletions Documentation/Reference/extensions/UIColor.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
# `UIColor`

## Properties
### `grayscaleColor`

```swift
var grayscaleColor: GrayscaleColor
```

> The GrayscaleColor representation of the UIColor instance.
### `hsbaColor`

```swift
Expand Down
Binary file modified Documentation/sheetycolors.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use_frameworks!
platform :ios, '10.0'
platform :ios, '11.0'

target 'SheetyColors_Example' do
pod 'SheetyColors', :path => '../'
Expand Down
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ SPEC CHECKSUMS:
SheetyColors: 483d95d270f01dde725b68217b63704f1efc984b
SnapshotTesting: 9ca1d80f6322509a035856170c11d0571b1f7171

PODFILE CHECKSUM: 5b2abbedbad9c9292a41e99328101b079df5f152
PODFILE CHECKSUM: 9b39eb683f19af0f28a510f2ff148ddd0ce5f2a5

COCOAPODS: 1.6.0.rc.2
42 changes: 41 additions & 1 deletion Example/SheetyColors.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
834A36ED224E8C7400DECD37 /* SheetyColorsViewModelDelegateMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 834A36EC224E8C7400DECD37 /* SheetyColorsViewModelDelegateMock.swift */; };
834A36F2224E94FC00DECD37 /* SheetyColorsViewModelMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 834A36F1224E94FC00DECD37 /* SheetyColorsViewModelMock.swift */; };
834A36F4224E98F900DECD37 /* SheetyColorsViewMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 834A36F3224E98F900DECD37 /* SheetyColorsViewMock.swift */; };
83537FC222739E1400E91C39 /* UIColor+grayscaleColorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83537FC122739E1400E91C39 /* UIColor+grayscaleColorTests.swift */; };
83537FC52273A01000E91C39 /* GrayscaleViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83537FC42273A01000E91C39 /* GrayscaleViewModel.swift */; };
83681FE82231AC14000AB720 /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83681FE72231AC14000AB720 /* Storage.swift */; };
83DDE21A225FBCBC005F4CEF /* UIColor+rgbaColorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83DDE219225FBCBC005F4CEF /* UIColor+rgbaColorTests.swift */; };
83DDE21C2262204F005F4CEF /* GradientSliderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83DDE21B2262204F005F4CEF /* GradientSliderTests.swift */; };
Expand Down Expand Up @@ -76,6 +78,8 @@
834A36EC224E8C7400DECD37 /* SheetyColorsViewModelDelegateMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SheetyColorsViewModelDelegateMock.swift; sourceTree = "<group>"; };
834A36F1224E94FC00DECD37 /* SheetyColorsViewModelMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SheetyColorsViewModelMock.swift; sourceTree = "<group>"; };
834A36F3224E98F900DECD37 /* SheetyColorsViewMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SheetyColorsViewMock.swift; sourceTree = "<group>"; };
83537FC122739E1400E91C39 /* UIColor+grayscaleColorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+grayscaleColorTests.swift"; sourceTree = "<group>"; };
83537FC42273A01000E91C39 /* GrayscaleViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GrayscaleViewModel.swift; sourceTree = "<group>"; };
83681FE72231AC14000AB720 /* Storage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Storage.swift; sourceTree = "<group>"; };
83DDE219225FBCBC005F4CEF /* UIColor+rgbaColorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+rgbaColorTests.swift"; sourceTree = "<group>"; };
83DDE21B2262204F005F4CEF /* GradientSliderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GradientSliderTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -180,6 +184,7 @@
607FACE81AFB9204008FA782 /* Tests */ = {
isa = PBXGroup;
children = (
83537FBE22739D8700E91C39 /* Grayscale */,
832DCEFC226E4D5900DAF3EF /* HSB */,
834A36EA224E893B00DECD37 /* Common */,
834A36EB224E894900DECD37 /* RGB */,
Expand Down Expand Up @@ -289,9 +294,9 @@
834A36EA224E893B00DECD37 /* Common */ = {
isa = PBXGroup;
children = (
834A36E9224E88FB00DECD37 /* Factories */,
83DDE21F2264FD06005F4CEF /* Models */,
83205EE22256812D00D62BB8 /* Views */,
834A36E9224E88FB00DECD37 /* Factories */,
);
name = Common;
sourceTree = "<group>";
Expand All @@ -305,6 +310,39 @@
name = RGB;
sourceTree = "<group>";
};
83537FBE22739D8700E91C39 /* Grayscale */ = {
isa = PBXGroup;
children = (
83537FC322739FFA00E91C39 /* ViewModels */,
83537FBF22739D9600E91C39 /* Models */,
);
name = Grayscale;
sourceTree = "<group>";
};
83537FBF22739D9600E91C39 /* Models */ = {
isa = PBXGroup;
children = (
83537FC022739DF600E91C39 /* Extensions */,
);
name = Models;
sourceTree = "<group>";
};
83537FC022739DF600E91C39 /* Extensions */ = {
isa = PBXGroup;
children = (
83537FC122739E1400E91C39 /* UIColor+grayscaleColorTests.swift */,
);
name = Extensions;
sourceTree = "<group>";
};
83537FC322739FFA00E91C39 /* ViewModels */ = {
isa = PBXGroup;
children = (
83537FC42273A01000E91C39 /* GrayscaleViewModel.swift */,
);
name = ViewModels;
sourceTree = "<group>";
};
83DDE217225FBC99005F4CEF /* Models */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -605,6 +643,8 @@
834A36E2224971F700DECD37 /* SheetyColorsViewFactoryTests.swift in Sources */,
831FCF0022591DFE003C48A4 /* UIAlertController+customViewTests.swift in Sources */,
831FCF02225E62F8003C48A4 /* SheetyColorsViewTests.swift in Sources */,
83537FC52273A01000E91C39 /* GrayscaleViewModel.swift in Sources */,
83537FC222739E1400E91C39 /* UIColor+grayscaleColorTests.swift in Sources */,
834A36E8224E88F400DECD37 /* RGBViewModelTests.swift in Sources */,
834A36ED224E8C7400DECD37 /* SheetyColorsViewModelDelegateMock.swift in Sources */,
83205EE52256815500D62BB8 /* UIView+findLabelTests.swift in Sources */,
Expand Down
3 changes: 3 additions & 0 deletions Example/SheetyColors/ColorsCollectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ class ColorsCollectionViewController: UICollectionViewController {

func openColorTypeSelection(forAction action: SheetType) {
let colorTypeSelectionSheet = UIAlertController(title: "Color Type", message: "Select a color type to use for your color picker.", preferredStyle: .actionSheet)
colorTypeSelectionSheet.addAction(UIAlertAction(title: "Grayscale", style: .default, handler: { _ in
self.openColorPicker(withAction: action, colorType: .grayscale)
}))
colorTypeSelectionSheet.addAction(UIAlertAction(title: "HSB", style: .default, handler: { _ in
self.openColorPicker(withAction: action, colorType: .hsb)
}))
Expand Down
Loading

0 comments on commit f0deb93

Please sign in to comment.