Download the PHP package nikkanetiya/laravel-color-palette without Composer
On this page you can find all versions of the php package nikkanetiya/laravel-color-palette. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nikkanetiya/laravel-color-palette
More information about nikkanetiya/laravel-color-palette
Files in nikkanetiya/laravel-color-palette
Package laravel-color-palette
Short Description Laravel Wrapper for `ksubileau/color-thief-php`. Grabs the dominant color or a representative color palette from an image. Uses PHP and GD or Imagick.
License
Homepage https://github.com/nikkanetiya/laravel-color-palette
Informations about the package laravel-color-palette
Laravel Color Palette
Laravel Wrapper for Color-Thief-PHP with additional changes. Grabs the dominant color or a representative color palette from an image. Uses PHP and GD or Imagick.
This Laravel package is extremely useful to grab dominant color or a representative color palette from images. See this image for the example.
Contents
- Installation
- Available Methods
Installation
You can install the package via Composer:
You must install the service provider (For Laravel < 5.5):
Register facade:
Available Methods
-
getColor() - Use this method to get most dominant single color form image
Example:
Options
By default,
getColor
will have quality -> 10 and specific area -> null.Quality
can be int. 1 is the highest quality. There is a trade-off between quality and speed. The bigger the number, the faster the palette generation but the greater the likelihood that colors will be missed.Area
can be array|null $area[x,y,w,h]. It allows you to specify a rectangular area in the image in order to get colors only for this area. It needs to be an associative array with the following keys:- $area['x']: The x-coordinate of the top left corner of the area. Default to 0.
- $area['y']: The y-coordinate of the top left corner of the area. Default to 0.
- $area['w']: The width of the area. Default to image width minus x-coordinate.
- $area['h']: The height of the area. Default to image height minus y-coordinate.
-
getPalette() - Use this method to find representative color palette form image.
Example:
Options
colorCount
can be 2 to 256. It is the number of colors you want to retrieve for the image.Quality
&Area
is same as above.
Image Source: https://www.pexels.com
, google image
All versions of laravel-color-palette with dependencies
ksubileau/color-thief-php Version ^1.3
illuminate/support Version 5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*