FieldColorPickerViewController

@objcMembers open class FieldColorPickerViewController: UICollectionViewController

View controller for selecting a color for a FieldColor.

  • Array of colors for a simple-grid color picker. From: https://github.com/google/closure-library/blob/master/closure/goog/ui/colorpicker.js

    Declaration

    Swift

    open var colors = [
        // grays
        "#ffffff", "#cccccc", "#c0c0c0", "#999999", "#666666", "#333333", "#000000",
        // reds
        "#ffcccc", "#ff6666", "#ff0000", "#cc0000", "#990000", "#660000", "#330000",
        // oranges
        "#ffcc99", "#ff9966", "#ff9900", "#ff6600", "#cc6600", "#993300", "#663300",
        // yellows
        "#ffff99", "#ffff66", "#ffcc66", "#ffcc33", "#cc9933", "#996633", "#663333",
        // olives
        "#ffffcc", "#ffff33", "#ffff00", "#ffcc00", "#999900", "#666600", "#333300",
        // greens
        "#99ff99", "#66ff99", "#33ff33", "#33cc00", "#009900", "#006600", "#003300",
        // turquoises
        "#99ffff", "#33ffff", "#66cccc", "#00cccc", "#339999", "#336666", "#003333",
        // blues
        "#ccffff", "#66ffff", "#33ccff", "#3366ff", "#3333ff", "#000099", "#000066",
        // purples
        "#ccccff", "#9999ff", "#6666cc", "#6633ff", "#6600cc", "#333399", "#330099",
        // violets
        "#ffccff", "#ff99ff", "#cc66cc", "#cc33cc", "#993399", "#663366", "#330033",
        ]
  • Preferred number of colors to display per row (this value may not be respected if there is not enough space available).

    Declaration

    Swift

    open var preferredColorsPerRow = 7
  • The size of each color button

    Declaration

    Swift

    open var buttonSize: CGSize = CGSize(width: 44, height: 44)
  • The color field to display

    Declaration

    Swift

    open var color: UIColor?
  • Delegate for events that occur on this controller

    Declaration

    Swift

    open weak var delegate: FieldColorPickerViewControllerDelegate?