Skip to content

A series of Twig filters and tests for color manipulations

License

Notifications You must be signed in to change notification settings

mikealmond/twig-color-extension

Repository files navigation

twig-color-extension

Build Status Code Coverage Scrutinizer Code Quality

This library will allow you to alter colors, check readability, and generate different palettes based on a base color.

Install

Via Composer

$ composer require mikealmond/twig-color-extension

Usage

{{ '0099FF'|color_darken(20)|color_css_rgba(0.9) }}
{{ '0099FF' is color_dark ? 'dark' : 'light' }}
{{ '0099FF'|color_complementary(30)|color_css_hex }}
{{ '0099FF' is color_low_contrast ? 'default-color' : '0099FF'|color_css_hex }}

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.