Skip to content

Convert, compare, and animate colors.

License

Notifications You must be signed in to change notification settings

mattacosta/php-colorspace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-colorspace

CI

Convert, compare, and animate colors.

Features

Color spaces

Color difference metrics

Illuminants (part of the CieXyzColor class)

  • D50
  • D65

Animation

  • Linear interpolation between colors

Requirements

  • PHP 8.1 or later

Installation

composer require mattacosta/php-colorspace

Usage

Example: Converting between color spaces (or alternate representations) using the ColorConverter class:

$hsl_color = ColorConverter::rgbToHsl($rgb_color);

Example: Computing the difference between two colors using the ColorDifference class:

$deltaE = ColorDifference::deltaE2000($reference, $sample);

Example: Transitioning from one color to another:

// Tip: Use a cylindrical representation for best results.
$yellow = HsvColor::lerp($red, $green, 0.5);

About

Convert, compare, and animate colors.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages