colourlovers

PHP library to request Colour Lovers REST Api.


Project maintained by defro Hosted on GitHub Pages — Theme by mattgraham

This library writing in PHP make request easier to make API request to ColourLovers API.

Installation

Use Composer to install this package as a requirement like this :

composer require defro/colourlovers

Usage

Initialization

$client = new \GuzzleHttp\Client();
$api = new \Defro\Google\ColourLovers\Api($client);

Get random palette

$palette = $api->getRandomPalette();

Get color by hexadecimal

$imgUrl = $api->getColor('FFFFFF');

Get palette by ID

$imgUrl = $api->getPaletteById(414237);

Run it locally in a Docker container

You can run example script and unit tests in included Docker container, read how to do it.