Latest 1.0.0
Homepage https://github.com/william205/WSColourScheme
License MIT
Platforms ios 8.0
Authors

GitHub issues
GitHub forks
GitHub stars
GitHub license
[CocoaPods]()
[CocoaPods]()
[CocoaPods]()
[CocoaPods]()
[CocoaPods]()
Twitter

Easy to use colour schemes and colour manipulation.

Colour Schemes

Dark Sea (WSCSchemeDarkSea)

DarkSea
DarkSea
DarkSea
DarkSea
DarkSea

Earth (WSCSchemeEarth)

Earth
Earth
Earth
Earth
Earth

Malachite (WSCSchemeMalachite)

Malachite
Malachite
Malachite
Malachite
Malachite

 Aquamarine (WSCSchemeAquamarine)

Aquamarine
Aquamarine
Aquamarine
Aquamarine
Aquamarine

Tangelo (WSCSchemeTangelo)

Tangelo
Tangelo
Tangelo
Tangelo
Tangelo

Amaranth (WSCSchemeAmaranth)

Tangelo
Tangelo
Tangelo
Tangelo
Tangelo

Paradise (WSCSchemeParadise)

Paradise
Paradise
Paradise
Paradise
Paradise

 Sunglow (WSCSchemeSunglow)

Sunglow
Sunglow
Sunglow
Sunglow
Sunglow

 Cerulean (WSCSchemeCerulean)

Cerulean
Cerulean
Cerulean
Cerulean
Cerulean

 Eucalyptus (WSCSchemeEucalyptus)

Eucalyptus
Eucalyptus
Eucalyptus
Eucalyptus
Eucalyptus

 Desire (WSCSchemeDesire)

Desire
Desire
Desire
Desire
Desire

 Sea (WSCSchemeSea)

Sea
Sea
Sea
Sea
Sea

 Regalia (WSCSchemeRegalia)

Regalia
Regalia
Regalia
Regalia
Regalia

Vivid Sky (WSCSchemeVividSky)

VividSky
VividSky
VividSky
VividSky
VividSky

Lagoon (WSCSchemeLagoon)

Lagoon
Lagoon
Lagoon
Lagoon
Lagoon

Azureish (WSCSchemeAzureish)

Azureish
Azureish
Azureish
Azureish
Azureish

 Surf (WSCSchemeSurf)

Surf
Surf
Surf
Surf
Surf

Waterspout (WSCSchemeWaterspout)

Waterspout
Waterspout
Waterspout
Waterspout
Waterspout

Chestnut (WSCSchemeChestnut)

Chestnut
Chestnut
Chestnut
Chestnut
Chestnut

Pastel (WSCSchemePastel)

Pastel
Pastel
Pastel
Pastel
Pastel

Picton (WSCSchemePicton)

Picton
Picton
Picton
Picton
Picton

Sienna (WSCSchemeSienna)

Sienna
Sienna
Sienna
Sienna
Sienna

Licorice (WSCSchemeLicorice)

Licorice
Licorice
Licorice
Licorice
Licorice

Cardinal (WSCSchemeCardinal)

Cardinal
Cardinal
Cardinal
Cardinal
Cardinal

 Lazuli (WSCSchemeLazuli)

Lazuli
Lazuli
Lazuli
Lazuli
Lazuli

Isabelline (WSCSchemeIsabelline)

Isabelline
Isabelline
Isabelline
Isabelline
Isabelline

Russet (WSCSchemeRusset)

Russet
Russet
Russet
Russet
Russet

 Bistre (WSCSchemeBistre)

Bistre
Bistre
Bistre
Bistre
Bistre

Tuscany (WSCSchemeTuscany)

Tuscany
Tuscany
Tuscany
Tuscany
Tuscany

Blossom (WSCSchemeBlossom)

Blossom
Blossom
Blossom
Blossom
Blossom

Tea (WSCSchemeTea)

Tea
Tea
Tea
Tea
Tea

Jelly Bean (WSCSchemeJellyBean)

JellyBean
JellyBean
JellyBean
JellyBean
JellyBean

 Weldon (WSCSchemeWeldon)

Weldon
Weldon
Weldon
Weldon
Weldon

Periwinkle (WSCSchemePeriwinkle)

Periwinkle
Periwinkle
Periwinkle
Periwinkle
Periwinkle

Tulip (WSCSchemeTulip)

Tulip
Tulip
Tulip
Tulip
Tulip

Blue Bell (WSCSchemeBlueBell)

BlueBell
BlueBell
BlueBell
BlueBell
BlueBell

 Ochre (WSCSchemeOchre)

Ochre
Ochre
Ochre
Ochre
Ochre

 Moon Stone (WSCSchemeMoonStone)

MoonStone
MoonStone
MoonStone
MoonStone
MoonStone

Whites (WSCSchemeWhites)

Whites
Whites
Whites
Whites
Whites

 Midnight (WSCSchemeMidnight)

Midnight
Midnight
Midnight
Midnight
Midnight

Installation

Via CocoaPods

pod 'WSColourScheme'

Via Download

Download the source files by either cloning the repository or downloading a ZIP of its contents.

How To Use

Including WSColourScheme

Import the WSColourScheme.h file in the classes your need it in.

#import "WSColourScheme.h"

You access the properties and methods of the WSColourScheme class in the following way:

[WSColourScheme sharedInstance].property;
[[WSColourScheme sharedInstance] method];

If you are accessing multiple properties or calling multiple methods then you can store the instance in a variable like so.

WSColourScheme *wscs = [WSColourScheme sharedInstance];

wscs.property;
[wscs method];

 Setting the colour scheme

[WSColourScheme sharedInstance].colourScheme = WSCSchemeDarkSea;

Setting a custom colour scheme

You must set five colours for a custom colour scheme.

NSArray *colourArray = @[
                        @"R,G,B",
                        @"R,G,B",
                        @"R,G,B",
                        @"R,G,B",
                        @"R,G,B",
                        ];

[WSColourScheme sharedInstance].customColours = colourArray;

Application Wide Colour Scheme

You can set the colour scheme in your AppDelegate.m inside the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method.

Using Colours

Each colour in a scheme is identified as a WSCSColour, there are five identifiers because there are five colours in each scheme.

WSCSColourOne //First colour in the scheme
WSCSColourTwo //Second colour in the scheme
WSCSColourThree //Third colour in the scheme
WSCSColourFour //Fourth colour in the scheme
WSCSColourFive //Fifth colour in the scheme

There are two methods for getting a colour. The first getColour:(WSCSColour)colour gets the specified colour with an alpha of 1, the second getColour:(WSCSColour)colour withAlpha:(float)alpha gets the specified colour with an alpha value of your choosing.

For example:

myView1.backgroundColor = [[WSColourScheme sharedInstance] getColour:WSCSColourOne];

myView2.backgroundColor = [[WSColourScheme sharedInstance] getColour:WSCSColourOne withAlpha:0.5f];

Making A Colour Lighter/Darker

Using WSColourScheme you can make colours lighter and darker, all you need to do is pass a UIColor and a percentage to the adjustBrightnessForColour:(UIColor *)colour byPercentage:(float)percentage method.

//Lighter
myColourOne = [[WSColourScheme sharedInstance] adjustBrightnessForColour:myColourOne byPercentage:0.4];

//Darker
myColourTwo = [[WSColourScheme sharedInstance] adjustBrightnessForColour:myColourTwo byPercentage:-0.7];

The percentage must be between -1 and +1, negative numbers will make the colour darker and positive numbers will make it brighter.

Colour Manipulation

Each adjustment is identified as a WSCSAdjust, there are five adjustments that you can make:

WSCSAdjustSaturated
WSCSAdjustDesaturated
WSCSAdjustGreyscale
WSCSAdjustComplement
WSCSAdjustInvert

To use these all you need to is pass a UIColor and a WSCSAdjust value to the adjustColour:(UIColor *)colour withAdjustment:(WSCSAdjust)adjustment method.

//Saturated
myColourOne = [[WSColourScheme sharedInstance] adjustColour:myColourOne withAdjustment:WSCSAdjustSaturated];

//Desaturated
myColourTwo = [[WSColourScheme sharedInstance] adjustColour:myColourTwo withAdjustment:WSCSAdjustDesaturated];

//Greyscale
myColourThree = [[WSColourScheme sharedInstance] adjustColour:myColourThree withAdjustment:WSCSAdjustGreyscale];

//Invert
myColourFour = [[WSColourScheme sharedInstance] adjustColour:myColourFour withAdjustment:WSCSAdjustInvert];

//Complement
myColourFive = [[WSColourScheme sharedInstance] adjustColour:myColourFive withAdjustment:WSCSAdjustComplement];

Coming Soon

  • Get HEX, CMYK, HSV, HSL, LAB, and NCS values for a UIColor
  • Turn HEX, CMYK, HSV, HSL, LAB, and NCS values into a UIColor

Licence

WSColourScheme is licensed under the MIT license. See License File for more information.

Contact

Visit my website http://www.willswan.com or tweet me @william205

Latest podspec

{
    "name": "WSColourScheme",
    "version": "1.0.0",
    "summary": "Easy to use beautiful colour schemes and colour manipulation.",
    "description": "WSColourScheme is an easy to use class that contains beautiful predefined colour schemes as well as the ability to set your own custom colour scheme. It also features colour manipulation tools including, Colour Lighter/Darker Control, Colour Saturation, Colour Desaturation, Colour Greyscale, Colour Complement, and Colour Invert.",
    "homepage": "https://github.com/william205/WSColourScheme",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Will Swan": "[email protected]"
    },
    "source": {
        "git": "https://github.com/william205/WSColourScheme.git",
        "tag": "1.0.0"
    },
    "social_media_url": "https://twitter.com/william205",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "WSColourScheme/Classes/**/*"
}

Pin It on Pinterest

Share This