Skip to content

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

License

Notifications You must be signed in to change notification settings

fullscreeninteractive/silverstripe-colorpalette

 
 

Repository files navigation

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',
	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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 74.1%
  • Scheme 14.7%
  • CSS 11.2%