Latest 0.0.1
Homepage https://github.com/cemolcay/ColorPalette
License MIT
Platforms ios 8.0, requires ARC
Authors

A color palette grid view for iOS.

Demo

alt tag

Requirements

  • Swift 3.0+
  • iOS 8.0+

Install

pod 'ColorPalette'

Usage

Create a ColorPaletteView either from storyboard or programmatically.
Set rowCount and columnCount to setup palette grid. (Defaults 2×10).
Implement delegate and dataSource.
Call reloadPalette() function to reload with new colors.

ColorPaletteViewDataSource

Use this data source method to fill palette with colors.

func colorPalette(_ colorPalette: ColorPaletteView, colorAt index: Int) -> UIColor?

ColorPaletteViewDelegate

Use this delegate method to inform about color selection changes.

func colorPalette(_ colorPalette: ColorPaletteView, didSelect color: UIColor, at index: Int)

You can also observe colorPalette.selectedColor dynamic property to create bindings.

ColorPaletteItemViewOptions

This is a basic struct with border, corner radius, and background color properties of palette items with their selected or unselected states.

You can use either colorPalette.paletteItemDisplayOptions property to set each property or use the @IBInspectable bridge properties from storyboard.

alt tag

Latest podspec

{
    "name": "ColorPalette",
    "version": "0.0.1",
    "summary": "A color palette grid view for iOS.",
    "description": "ColorPaletten===nnA color palette grid view for iOS.nnDemon----nn![alt tag](https://github.com/cemolcay/ColorPalette/raw/master/demo.gif)nnRequirementsn----nn* Swift 3.0+n* iOS 8.0+nnInstalln----nn``` rubynpod 'ColorPalette'n```nnUsagen----nnCreate a `ColorPaletteView` either from storyboard or programmatically.nSet `rowCount` and `columnCount` to setup palette grid. (Defaults 2x10).nImplement `delegate` and `dataSource`.nn#### ColorPaletteViewDataSourcennUse this data source method to fill palette with colors.nn```nfunc colorPalette(_ colorPalette: ColorPaletteView, colorAt index: Int) -> UIColor?n```nn#### ColorPaletteViewDelegatennUse this delegate method to inform about color selection changes.nn```nfunc colorPalette(_ colorPalette: ColorPaletteView, didSelect color: UIColor, at index: Int)n```nnYou can also observe `colorPalette.selectedColor` dynamic property to create bindings.nn#### ColorPaletteItemViewOptionsnnThis is a basic struct with border, corner radius, and background color properties of palette items with their selected or unselected states.nnYou can use either `colorPalette.paletteItemDisplayOptions` property to set each property or use the `@IBInspectable` bridge properties from storyboard.nn![alt tag](https://github.com/cemolcay/ColorPalette/raw/master/storyboard.png)",
    "homepage": "https://github.com/cemolcay/ColorPalette",
    "license": "MIT",
    "authors": {
        "cemolcay": "[email protected]"
    },
    "social_media_url": "http://twitter.com/cemolcay",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/cemolcay/ColorPalette.git",
        "tag": "0.0.1"
    },
    "source_files": "ColorPalette/ColorPaletteView.swift",
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This