heyday/silverstripe-colorpalette

A color palette picker for SilverStripe CMS

Installs: 123 387

Dependents: 11

Suggesters: 0

Security: 0

Stars: 22

Watchers: 33

Forks: 16

Open Issues: 0

Type:silverstripe-vendormodule

3.0.0 2023-12-21 00:36 UTC

This package is auto-updated.

Last update: 2024-11-26 20:29:33 UTC


README

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

Features

  • Supports usage in Elemental

Usage

Regular palette

$fields->addFieldToTab(
    'Root.Main',
    Heyday\ColorPalette\Fields\ColorPaletteField::create(
        'BackgroundColor',
        'Background Color',
        [
            'White' => '#fff',
            'Black' => '#000'
        ]
    )
);

Grouped Palette

$fields->addFieldToTab(
    'Root.Main',
    Heyday\ColorPalette\Fields\GroupedColorPaletteField::create(
        'BackgroundColor',
        'Background Color',
        array(
            'Primary Palette' => [
                'White' => '#fff',
                'Black' => '#000'
            ],
            'Secondary Palette' => [
                'Blue' => 'blue',
                'Red' => 'red'
            ]
        )
    )
);

License

SilverStripe Color Palette Field is licensed under an MIT license