MDCPalette

@interface MDCPalette : NSObject

A palette of Material colors.

Material palettes have a set of named tint colors and an optional set of named accent colors. This class provides access to the pre-defined set of Material palettes. MDCPalette objects are immutable; it is safe to use them from multiple threads in your app.

  • The red palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class) MDCPalette *redPalette;
  • The pink palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class) MDCPalette *pinkPalette;
  • The purple palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class)
        MDCPalette *purplePalette;
  • The deep purple palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class)
        MDCPalette *deepPurplePalette;
  • The indigo palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class)
        MDCPalette *indigoPalette;
  • The blue palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class) MDCPalette *bluePalette;
  • The light blue palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class)
        MDCPalette *lightBluePalette;
  • The cyan palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class) MDCPalette *cyanPalette;
  • The teal palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class) MDCPalette *tealPalette;
  • The green palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class) MDCPalette *greenPalette;
  • The light green palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class)
        MDCPalette *lightGreenPalette;
  • The lime palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class) MDCPalette *limePalette;
  • The yellow palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class)
        MDCPalette *yellowPalette;
  • The amber palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class) MDCPalette *amberPalette;
  • The orange palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class)
        MDCPalette *orangePalette;
  • The deep orange palette.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class)
        MDCPalette *deepOrangePalette;
  • The brown palette (no accents).

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class) MDCPalette *brownPalette;
  • The grey palette (no accents).

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class) MDCPalette *greyPalette;
  • The blue grey palette (no accents).

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull, class)
        MDCPalette *blueGreyPalette;
  • Returns a palette generated from a single target 500 tint color.

    TODO(ajsecord): Document the algorithm used to generate the palette.

    Declaration

    Objective-C

    + (nonnull instancetype)paletteGeneratedFromColor:
        (nonnull UIColor *)target500Color;

    Parameters

    target500Color

    The target 500 color in the palette.

    Return Value

    A palette generated with a 500 color matching the target color.

  • Returns a palette with a custom set of tints and accents.

    The tints dictionary must have values for each key matching MDCPaletteTint.*Name. The accents dictionary, if specified, may have entries for each key matching MDCPaletteAccent.*Name. Missing accent values will cause an assert in debug mode and will return +[UIColor clearColor] in release mode when the corresponding property is acccessed.

    Declaration

    Objective-C

    + (nonnull instancetype)
    paletteWithTints:(nonnull NSDictionary<MDCPaletteTint, UIColor *> *)tints
             accents:(nullable NSDictionary<MDCPaletteAccent, UIColor *> *)accents;

    Parameters

    tints

    A dictionary mapping MDCPaletteTint.*Name keys to UIColors.

    accents

    An optional dictionary mapping MDCPaletteAccent.*Name keys to UIColors.

    Return Value

    An palette containing the custom colors.

  • Returns an initialized palette object with a custom set of tints and accents.

    The tints dictionary must have values for each key matching MDCPaletteTint.*Name. The accents dictionary, if specified, may have entries for each key matching MDCPaletteAccent.*Name. Missing accent values will cause an assert in debug mode and will return +[UIColor clearColor] in release mode when the corresponding property is acccessed.

    Declaration

    Objective-C

    - (nonnull instancetype)
    initWithTints:(nonnull NSDictionary<MDCPaletteTint, UIColor *> *)tints
          accents:(nullable NSDictionary<MDCPaletteAccent, UIColor *> *)accents;

    Parameters

    tints

    A dictionary mapping MDCPaletteTint.*Name keys to UIColors.

    accents

    An optional dictionary mapping MDCPaletteAccent.*Name keys to UIColors.

    Return Value

    An initialized MDCPalette object containing the custom colors.

  • The 50 tint color, the lightest tint of the palette.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) UIColor *tint50;
  • The 100 tint color.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) UIColor *tint100;
  • The 200 tint color.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) UIColor *tint200;
  • The 300 tint color.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) UIColor *tint300;
  • The 400 tint color.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) UIColor *tint400;
  • The 500 tint color, the representative tint of the palette.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) UIColor *tint500;
  • The 600 tint color.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) UIColor *tint600;
  • The 700 tint color.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) UIColor *tint700;
  • The 800 tint color.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) UIColor *tint800;
  • The 900 tint color, the darkest tint of the palette.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) UIColor *tint900;
  • The A100 accent color, the lightest accent color.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) UIColor *accent100;
  • The A200 accent color.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) UIColor *accent200;
  • The A400 accent color.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) UIColor *accent400;
  • The A700 accent color, the darkest accent color.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) UIColor *accent700;