Color Palette PHP

A powerful PHP library for extracting color palettes from images and generating color themes. This package supports multiple image processing backends (GD and Imagick) and provides a rich set of color manipulation features.

Latest Stable Version Build Status Total Downloads License
Primary
Secondary
Text
Background

🎨 Key Features

Advanced Color Extraction

Comprehensive Color Space Support

Powerful Color Manipulation

Intelligent Theme Generation

🚀 Quick Start

Installation

composer require farzai/color-palette

Basic Usage

use Farzai\ColorPalette\ImageFactory;
use Farzai\ColorPalette\ColorExtractorFactory;
use Farzai\ColorPalette\ColorPalette;

// Create an image instance
$imageFactory = new ImageFactory();
$image = $imageFactory->createFromPath('path/to/image.jpg');

// Extract colors
$extractorFactory = new ColorExtractorFactory();
$extractor = $extractorFactory->make('gd'); // or 'imagick'
$colors = $extractor->extract($image, 5); // Extract 5 dominant colors

// Create a palette and get color suggestions
$palette = new ColorPalette($colors);
$textColor = $palette->getSuggestedTextColor($colors[0]);
$surfaceColors = $palette->getSuggestedSurfaceColors();

📚 Documentation

Our comprehensive documentation covers everything you need:

🏁 Getting Started

Quick installation and basic setup guide to get you up and running.

🎯 Core Concepts

Deep dive into color spaces, manipulation, and best practices.

📖 API Reference

Complete API documentation with detailed examples and use cases.

💡 Examples

Real-world examples and code snippets for common scenarios.

🎮 Color Playground

Interactive demo to experiment with color manipulation features.

🛠 Requirements

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

📄 License

The Color Palette PHP library is open-sourced software licensed under the MIT license.

📦 Resources