Download the PHP package toastnz/theme-colours without Composer
On this page you can find all versions of the php package toastnz/theme-colours. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download toastnz/theme-colours
More information about toastnz/theme-colours
Files in toastnz/theme-colours
Package theme-colours
Short Description Silverstripe theme colours module
License BSD-3-Clause
Informations about the package theme-colours
Installation
The easiest way is to use composer:
composer require toastnz/theme-colours
Run dev/build
afterwards.
Configuration
Add the following to your config.yml
(optional) to generate default colours on dev/build
Colours with a hex value will be locked and not editable in the CMS
Colours with null value will be editable in the CMS
Usage
Colour functions
returns either the ID set in the config.yml, or for additional colours, returns the ID
returns a combination of the getColourCustomID() and the Title, so the data object can be found from the selected colour palette field value.
returns c-
+ getColourCustomID()
so the css class is unique. c-
is there to represent colour
and to ensure the class does not start with a number.
returns either dark
or light
based on their luminocity of the colour value.
returns the hex value of the colour
will return a combination of the getColourClassName()
and getColourBrightness()
Helper functions
to loop through the $themeColours and add the Title and Value to the $array for ColorPaletteField to use.
to loop through the $themeColours and return the object that matches the $colourPaletteID
All versions of theme-colours with dependencies
silverstripe/cms Version ^6
tractorcow/silverstripe-colorpicker Version dev-master
heyday/silverstripe-colorpalette Version dev-main