heyday/silverstripe-colorpalette

A color palette picker for SilverStripe CMS

Installs: 71 875

Dependents: 8

Suggesters: 0

Security: 0

Stars: 21

Watchers: 31

Forks: 14

Open Issues: 6

Type:silverstripe-vendormodule

2.0.4 2021-03-09 20:51 UTC

This package is auto-updated.

Last update: 2021-11-09 22:20:18 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

Usage

Regular palette

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

Grouped Palette

$fields->addFieldToTab(
	'Root.Main',
	Heyday\ColorPalette\Fields\GroupedColorPaletteField::create(
		'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