Skip to content

Simple Image Color filter for Craft CMS to extract colors from images.

Notifications You must be signed in to change notification settings

MattWilcox/craft-image-color

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Image Color Filter for Craft CMS

Simple Image Color filter for Craft CMS.

Grabs the most prominate colors from any image asset using a twig filter on an assets object

Usage

<div style="background-color: url({{ entry.image[0]|imageColor }})">

	<img src="{{ entry.image[0].url }}"/>
</div>

Grabs the second most prominate color (0 index). Currently saves up to 5 colors per image

<div style="background-color: url({{ entry.image[0]|imageColor(1) }})">

	<img src="{{ entry.image[0].url }}"/>
</div>

To-do

Working on a number of new features

  • Settings screen to set number of colors saved
  • Assets fieldtype to show dropdown of colors and letting you select which one to use on an image by image basis
  • Better error checking and defaults.

About

Simple Image Color filter for Craft CMS to extract colors from images.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 63.3%
  • CSS 36.0%
  • HTML 0.7%