mikealmond/twig-color-extension

A series of Twig filters for color manipulations

v0.0.8 2022-09-21 16:57 UTC

This package is auto-updated.

Last update: 2024-11-21 21:55:25 UTC


README

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.