Skip to content

Rhym/silverstripe-color-field

Repository files navigation

SilverStripe Color Field

Latest Stable Version Total Downloads Monthly Downloads

A colour picker field for the Silverstripe CMS.

Uses Iris Colour Picker.

Installation

Installation with composer:

composer require ryanpotter/silverstripe-color-field

Usage

use RyanPotter\SilverStripeColorField\Forms\ColorField;
private static $db = [
    'MyColor' => DBVarchar::class . '(7)',
];
ColorField::create('MyColor')

Screenshot

Screenshot

Configuration

Add as many colours as you want to the palettes.

RyanPotter\SilverStripeColorField\Forms\ColorField:
  colors:
    - '#1976D2'
    - '#2196F3'
    - '#BBDEFB'
    - '#FFFFFF'
    - '#FF4081'
    - '#212121'
    - '#727272'
    - '#B6B6B6'