Build with PHPColor

Start from the beginning, follow a focused Guide, solve one task with a recipe, or look up the API.

Learn the library

Getting Started

One connected path from installation to production CSS.

Begin the walkthrough
  1. Install Add the package
  2. Create Parse your first color
  3. Inspect Use the color object
  4. Compare Measure relationships
  5. Compose Mix and transform
  6. Output Ship modern CSS

Understand a decision

The Guide

Short chapters for choosing an input, a space, an operation, or an output.

Browse the complete Guide

Complete one task

Recipes

Copyable, verified solutions with the decision already made.

  • Validate CSS inputtryFrom()
  • Build a tonal scalelightnessScale()
  • Repair contrastContrastSolver
Find a recipe

Look up the contract

API Reference

Classes, signatures, parameters, return values, and exceptions from the installed library.

Color::parse()
ColorInterface
Color::mix()
ColorInterface
Color::contrast()
float
Browse the API