Skip to content

Latest commit

 

History

History
 
 

Palettes

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Palettes

The Palettes component provides Material colors organized into similar palettes.

Material Design Specifications


Installation

Requirements

  • Xcode 7.0 or higher.
  • iOS SDK version 7.0 or higher.

Installation with CocoaPods

To add this component to your Xcode project using CocoaPods, add the following to your Podfile:

pod 'MaterialComponents/Palettes'

Then, run the following command:

pod install

Usage

Importing

Before using Palettes, you'll need to import it:

Swift

import MaterialComponents.MaterialPalettes

Objective-C

#import "MaterialPalettes.h"

Using palettes

Much like UIColor objects, MDCPalette objects are immutable static objects you can use to obtain Material colors. All palettes have a set of tints with lower numbers being lighter colors and higher numbers being darker colors. The 500 tint is the most common representative color for its respective palette. Most palettes (but not all) also have a set of accent colors following a similar naming scheme.


Examples

Swift

view.backgroundColor = MDCPalette.green().tint500;

Objective-C

self.view.backgroundColor = [MDCPalette greenPalette].tint500;