mattgxyz / twig-hex-color-change-extension
Twig extension to lighten or darken a given hex value by 20%, or to shade it by a given %
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Installs: 416
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 1
pkg:composer/mattgxyz/twig-hex-color-change-extension
Requires
- php: >=5.3.0
- twig/twig: >=1.12
This package is not auto-updated.
Last update: 2021-06-12 02:04:32 UTC
README
Twig extension to lighten or darken a given hex value by 20%, or to shade it by a given %
Installation
Install via composer:
composer require mattgxyz/twig-hex-color-changeextension
Add the following to your services.yml file:
twig.extension.hexcolorchange: class: MattgXyz\Twig\HexColorChangeExtension tags: - { name: twig.extension
Usage
{{ '#336699' | darken }}
{{ '#336699' | lighten }}
{{ '#336699' | shade(60) }}