Provides a color picker field in SilverStripe allowing a user to select from defined selection of colors (palette)
PHP Scheme CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
code
css
resources
templates
.gitattributes
.gitignore
.php_cs
LICENSE
README.md
_config.php
composer.json

README.md

SilverStripe Color Palette Field

Provides a color picker field in SilverStripe allowing a user to select from defined selection of colors (palette)

Installation (with composer)

$ composer require heyday/silverstripe-colorpalette

Example

Color Palette Example

Usage

Regular palette

$fields->addFieldToTab(
    'Root.Main',
    new ColorPaletteField(
        'BackgroundColor',
        'Background Color',
        array(
            'White' => '#fff',
            'Black' => '#000'
        )
    )
);

Grouped Palette

$fields->addFieldToTab(
    'Root.Main',
    new GroupedColorPaletteField(
        'BackgroundColor',
        'Background Color',
        array(
            'Primary Palette' => array(
                'White' => '#fff',
                'Black' => '#000'
            ),
            'Secondary Palette' => array(
                'Blue' => 'blue',
                'Red' => 'red'
            )
        )
    )
);

License

SilverStripe Color Palette Field is licensed under an MIT license