PHPackages                             matatirosoln/pantone-converter-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. matatirosoln/pantone-converter-bundle

ActiveLibrary[Templating &amp; Views](/categories/templating)

matatirosoln/pantone-converter-bundle
=====================================

A Symfony bundle to provide twig helpers to convert from a named Pantone coated colour to Hex

0.0.3(5y ago)0261MITPHPPHP &gt;=7.2

Since Sep 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/matatirosolutions/pantone-converter-bundle)[ Packagist](https://packagist.org/packages/matatirosoln/pantone-converter-bundle)[ RSS](/packages/matatirosoln-pantone-converter-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (7)Versions (4)Used By (0)

Pantone Converter Bundle
========================

[](#pantone-converter-bundle)

Wraps the [Pantone Converter](https://github.com/matatirosolutions/pantone-converter) to provide a Twig function to display a colour swatch

Installation
------------

[](#installation)

Require the bundle with composer

```
composer require matatirosoln/pantone-converter-bundle
```

Enable the bundle, for Flex

```
// in config/bundles.php
return [
	// ...
	MSDev\PantoneConverterBundle\PantoneConverterBundle::class => ['all' => true],
];
```

Or for Symfony 3.4

```
// in app/AppKernel.php
public function registerBundles() {
	$bundles = [
		// ...
		new MSDev\PantoneConverterBundle\PantoneConverterBundle(),
	];
	// ...
}
```

Usage
-----

[](#usage)

### Basic usage

[](#basic-usage)

In a Twig template use `pantone_swatch` passing the required colour as the parameter e.g.

```
{{ pantone_swatch('100 C') }}

```

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.

```
.pantone-swatch {
    display: inline-block;
    width: 50px;
    height: 50px;
}
```

### Error case

[](#error-case)

If you request a non-existent colour, the swatch will render with a white background, e.g.

```
{{ pantone_swatch('Foo C', 'This colour is missing') }}

```

will render the following HTML

```
This colour is missing
```

### Options

[](#options)

You can also pass an optional object as the second parameter with three possible values.

#### Content

[](#content)

Add content to the span (this can include HTML), e.g.

```
{{ pantone_swatch('100 C', {'content': 'This is yellow'}) }}

```

will render the following HTML

```
This is yellow
```

#### Border

[](#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.

```
{{ pantone_swatch('100 C', {'border': '#FF0000'}) }}

```

will render the following HTML

```

```

You'll need to set the other border parameters in your css, e.g.

```
.pantone-swatch {
    /*...*/
    border-width: 1px;
    border-style: solid;
}
```

#### Border when white

[](#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.

```
{{ pantone_swatch('100 C', {'borderWhite': '#FF0000'}) }}

```

will render the following HTML

```

```

because `100 C` is a valid colour, while

```
{{ pantone_swatch('Unknown Colour', {'borderWhite': '#FF0000'}) }}

```

will render the following HTML

```

```

As for a standard border you'll also need to set the other border parameters in your css.

License
-------

[](#license)

Copyright © 2020, Matatiro Solutions. Licensed under the [MIT License](LICENSE.md).

Note
----

[](#note)

- PANTONE® is a registered trademark of [Pantone Inc](https://www.pantone.com/).

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

3

Last Release

2062d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a9a4e991a9ff25d75fa75c464cabedc606b6ec1dda536404593bca257bf2b3d2?d=identicon)[matatirosolutions](/maintainers/matatirosolutions)

---

Top Contributors

[![steveWinter](https://avatars.githubusercontent.com/u/1171712?v=4)](https://github.com/steveWinter "steveWinter (3 commits)")

---

Tags

rgbhexcolorscmykpantone

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/matatirosoln-pantone-converter-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/matatirosoln-pantone-converter-bundle/health.svg)](https://phpackages.com/packages/matatirosoln-pantone-converter-bundle)
```

###  Alternatives

[a2lix/auto-form-bundle

Automate form building

873.8M11](/packages/a2lix-auto-form-bundle)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[ozdemirburak/iris

PHP library for color manipulation and conversion.

1201.7M16](/packages/ozdemirburak-iris)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[tecnickcom/tc-lib-color

PHP library to manipulate various color representations

247.2M9](/packages/tecnickcom-tc-lib-color)[iq2i/storia-bundle

UI Storia bundle

144.6k](/packages/iq2i-storia-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
