Skip to content

Commit

Permalink
Add a method for copying a colour scheme.
Browse files Browse the repository at this point in the history
  • Loading branch information
shysaur committed Nov 17, 2017
1 parent 6bca3d7 commit 2102f12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MGSColourScheme.h
Expand Up @@ -49,6 +49,10 @@ typedef NS_ENUM(NSUInteger, MGSColourSchemeErrorCode) {
* that describes the problem. */
- (instancetype)initWithSchemeFileURL:(NSURL *)file error:(NSError **)err;

/** Initializes a new colour scheme instance by copying another colour scheme.
* @param scheme The original colour scheme to copy. */
- (instancetype)initWithColourScheme:(MGSColourScheme *)scheme;

/** Initializes a new colour scheme instance with default properties. */
- (instancetype)init;

Expand Down
6 changes: 6 additions & 0 deletions MGSColourScheme.m
Expand Up @@ -73,6 +73,12 @@ - (instancetype)initWithSchemeFileURL:(NSURL *)file error:(NSError **)err
}


- (instancetype)initWithColourScheme:(MGSColourScheme *)scheme
{
return [self initWithDictionary:[scheme dictionaryRepresentation]];
}


/*
* - init
*/
Expand Down

0 comments on commit 2102f12

Please sign in to comment.