jacobbuck / silverstripe-dominantcolor
Enhance the Image class by providing the dominant color from an image.
Installs: 373
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 4
Open Issues: 0
Type:silverstripe-module
Requires
- ksubileau/color-thief-php: ~1.3
- silverstripe/framework: ~3.1
This package is not auto-updated.
Last update: 2022-08-06 16:13:11 UTC
README
Enhance the Image class by providing the dominant color from an image. Uses Color Thief PHP.
Usage
Adds the DominantColor()
method to Image
which the primary dominant color of this Image as hex (i.e. '#bada55'
.)
… <div style="background-color:$SomeImage.DominantColor"> …
… $color = Image::get()->find(…)->DominantColor(); …
Requirements
- Silverstripe 3+
- GD, Imagick or Gmagick
Installation
The recommended way to install is through Composer:
composer require jacobbuck/silverstripe-dominantcolor