The palette factory.

deprecated This class is deprecated for the moment, use the PaletteBuilder instead.

 Methods

Create a new legend from a list of properties.

createLegend(string $name, array|\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface $property, \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface $_) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface
Static
SuppressWarnings (PHPMD.ShortVariable)
SuppressWarnings (PHPMD.UnusedFormalParameter)
SuppressWarnings (PHPMD.CamelCaseParameterName)

Parameters

$name

string

The name of the legend.

$property

array\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface

A list of properties. Can be multiple arrays and arrays of arrays.

$_

\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface

A list of properties. Can be multiple arrays and arrays of arrays.

Returns

Create a new palette from a list of legends.

createPalette(string $name, array $legend, array $_) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface
Static
SuppressWarnings (PHPMD.ShortVariable)
SuppressWarnings (PHPMD.UnusedFormalParameter)
SuppressWarnings (PHPMD.CamelCaseParameterName)

Parameters

$name

string

The name of the palette, can be omitted (deprecated).

$legend

array

A list of legends. Can be multiple arrays and arrays of arrays.

$_

array

A list of legends. Can be multiple arrays and arrays of arrays.

Returns

Create a new palette collection from a list of palettes.

createPaletteCollection(array|\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface $palettes, \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface $_) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteCollectionInterface
Static
SuppressWarnings (PHPMD.ShortVariable)
SuppressWarnings (PHPMD.UnusedFormalParameter)
SuppressWarnings (PHPMD.CamelCaseParameterName)

Parameters

$palettes

array\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface

A list of palettes. Can be multiple arrays and arrays of arrays.

$_

\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface

A list of palettes. Can be multiple arrays and arrays of arrays.

Returns

Fill a legend from a multidimensional array of properties.

fillLegend(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface $legend, array $properties) : void
Static

Parameters

$properties

array

The properties.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralInvalidArgumentException When an invalid property is encountered.

Fill a palette from a multidimensional array of legends.

fillPalette(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface $palette, array $legends) : void
Static

Parameters

$legends

array

The legends.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralInvalidArgumentException When an invalid legend has been passed.

Fill a palette collection from a multidimensional array of palettes.

fillPaletteCollection(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteCollection $collection, array $palettes) : void
Static

Parameters

$palettes

array

The palettes to fill.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralInvalidArgumentException When an invalid palette has been passed.