Download the PHP package matatirosoln/pantone-converter-bundle without Composer
On this page you can find all versions of the php package matatirosoln/pantone-converter-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pantone-converter-bundle
Pantone Converter Bundle
Wraps the Pantone Converter to provide a Twig function to display a colour swatch
Installation
Require the bundle with composer
` Enable the bundle, for Flex
Or for Symfony 3.4
Usage
Basic usage
In a Twig template use pantone_swatch
passing the required colour as the parameter e.g.
`
will render the following HTML
You'll then want to apply styling to the pantone-swatch
class to display at an appropriate size for your implementation, e.g.
Error case
If you request a non-existent colour, the swatch will render with a white background, e.g. ` will render the following HTML
Options
You can also pass an optional object as the second parameter with three possible values.
Content
Add content to the span (this can include HTML), e.g. ` will render the following HTML
Border
Add a border of the specified colour to the swatch. This can be either an HTML named colour, or a hex colour, e.g. ` will render the following HTML
You'll need to set the other border parameters in your css, e.g.
Border when white
Add a border of the specified colour to the swatch but only if it is white. This may happen if the swatch is deliberately set to be white, or when an invalid colour is passed. This can be either an HTML named colour, or a hex colour, e.g. ` will render the following HTML
because 100 C
is a valid colour, while
`
will render the following HTML
As for a standard border you'll also need to set the other border parameters in your css.
License
Copyright © 2020, Matatiro Solutions. Licensed under the MIT License.
Note
- PANTONE® is a registered trademark of Pantone Inc.
All versions of pantone-converter-bundle with dependencies
matatirosoln/pantone-converter Version ^0.0.1
symfony/config Version ~3.4|~4.4|~5.1
symfony/dependency-injection Version ~3.4|~4.4|~5.1
symfony/twig-bundle Version ~3.4|~4.4|~5.1