Skip to content
Colour picker with configurable colours and a React component for SilverStripe CMS
JavaScript PHP CSS Scheme
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_config First commit Jul 10, 2019
client First commit Jul 10, 2019
src/Forms
templates/SilverStripe/Colorpicker/Forms First commit Jul 10, 2019
tests/Forms Fixed tests namespace Jul 25, 2019
.editorconfig First commit Jul 10, 2019
.eslintrc.js First commit Jul 10, 2019
.gitattributes First commit Jul 10, 2019
.gitignore
.scrutinizer.yml First commit Jul 10, 2019
.travis.yml
LICENSE.md First commit Jul 10, 2019
code-of-conduct.md
codecov.yml
composer.json Tests autoloading Jul 25, 2019
package.json Meta improvements Jul 21, 2019
phpcs.xml.dist First commit Jul 10, 2019
phpunit.xml.dist Test scaffold Jul 25, 2019
readme.md Meta improvements Jul 21, 2019
webpack.config.js First commit Jul 10, 2019
yarn.lock First commit Jul 10, 2019

readme.md

Colorpicker Module

Build Status Scrutinizer Code Quality codecov

This module adds a color picker field which can be used anywhere in the CMS.

In order to keep the site accessible, custom color selection is not implemented.

Installation

To install this module, you can do so with Composer:

composer require silverstripe/colorpicker

Usage

You can use the ColorPickerField as follows:

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $fields->addFieldsToTab(
            'Root.Main',
            [
                ColorPickerField::create(
                    'MyColorField',
                    _t(
                        __CLASS__ . '.MyColorField',
                        'My Color Field'
                    ),
                    [
                        [
                            'Title' => 'Red',
                            'CSSClass' => 'red',
                            'Color' => '#E51016',
                        ],
                        [
                            'Title' => 'Blue',
                            'CSSClass' => 'blue',
                            'Color' => '#1F6BFE',
                        ],
                        [
                            'Title' => 'Green',
                            'CSSClass' => 'green',
                            'Color' => '#298436',
                        ]
                    ]
                )
            ]
        );

        return $fields;
    }

Versioning

This library follows Semver. According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.

All methods, with public visibility, are part of the public API. All other methods are not part of the public API. Where possible, we'll try to keep protected methods backwards-compatible in minor/patch versions, but if you're overriding methods then please test your work before upgrading.

You can’t perform that action at this time.