tree: 29b51377349e3093eb60f7fc5516520c8a837d41 [path history] [tgz]
  1. docs/
  2. examples/
  3. src/
  4. tests/
  5. .jazzy.yaml
  6. README.md
components/Palettes/README.md

Palettes

The Palettes component provides Material colors organized into similar palettes.

Design & API Documentation


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;