Extract colors from image assets in Craft 3. The Craft 2 plugin is moved to another branch.
By using the imageColor
field on each asset, it doesn't require extra database queries when showing colors. On install it creates a task to extract the color for every image.
imageColor
on all assets of kind image (can be color or plaintext)Use the colorExtractor
twig filter to retrieve the image's color from templates.
<div style="background-color: {{ entry.images[0]|colorExtractor }};"></div>
From command:
craft color-extractor/default
Copyright © Born05
See license
Based upon craft-image-color plugin by familiar-studio.