Skip to content

Violet88github/opcolor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ColorField

Creates a colour palette dropdown for SilverStripe 3 or 4.

Color selector

OP color in the CMS

Create your accepted colors and names in the settings tab in the CMS

OP color in the settings

use the drop down to select your color

Expose the JS/css files

composer vendor-expose

Usage

	use OP\ColorField;
	public static $db = [
		'ClassOverride' => 'Text'
	];

	function getCMSFields() {
		$fields = parent::getCMSFields();
		// create the op color field
		$colordropdown = ColorField::create('ClassOverride', 'Color Override', $this->ClassOverride);
		$colordropdown->setEmptyString('');
		$fields->addFieldToTab("Root.Main", $colordropdown, "Content");
        
		return $fields;
	}

What it does

It stores the CSSColor in the specified text field. Note the RGB color is the value that colors the box in the dropdown field. Other values, such as the CSSHex and CSSCMYK are optional.

About

Colour palette field for SilverStripe

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 55.7%
  • JavaScript 32.1%
  • CSS 8.2%
  • Scheme 4.0%