Download the PHP package dustinwilson/pigmentum without Composer

On this page you can find all versions of the php package dustinwilson/pigmentum. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pigmentum

Pigmentum

Library for manipulating color in PHP. This is the result of my own experiments with color math. There are other color classes out there, but they either work not how I'd like or the math is incorrect.

Warning Before Using

This library is experimental. The code does not have any unit tests yet, but that work is planned. Until unit tests exist, treat this software as beta or even alpha software. Also, the public API is in flux, so if you do use this library you're forewarned of possible breaking API changes.

Requirements

Documentation

Color in Pigmentum is represented as a single color object. All color spaces are converted to and representated as XYZ D50 2° internally. Currently Pigmentum handles the following color spaces:

  1. CIEXYZ
    1. LMS
  2. CIELAB
  3. RGB
    1. HSB/V

Any color space supported in Pigmentum means that conversions to and from each color space is possible.

dW\Pigmentum\Color

Properties


dW\Pigmentum\Color::withLab

Creates a new dW\Pigmentum\Color object from L*a*b* values.

Example

dW\Pigmentum\Color::withLCHab

Creates a new dW\Pigmentum\Color object from L*C*H* (L*a*b*) values.

Example

dW\Pigmentum\Color::withRGB

Creates a new dW\Pigmentum\Color object from RGB values.

Example

Outputs:


dW\Pigmentum\Color::withRGBHex

Creates a new dW\Pigmentum\Color object from an RGB hex string.

Example

Outputs:


dW\Pigmentum\Color::withHSB

Creates a new dW\Pigmentum\Color object from RGB values.

Example

dW\Pigmentum\Color::withXYZ

Creates a new dW\Pigmentum\Color object from XYZ values.

Example

dW\Pigmentum\Color::toLab

Returns the L*a*b* color space for the color.

Example

Outputs:


dW\Pigmentum\Color::toRGB

Returns the RGB color space for the color.

Example

Outputs:


dW\Pigmentum\Color::toXYZ

Returns the XYZ color space for the color.

Example

Outputs:


dW\Pigmentum\Color::average

Averages the provided colors in the L*a*b* color space and returns a new Color object. Identical to dW\Pigmentum\Color::averageWithLab.

Example

Outputs:


dW\Pigmentum\Color::averageWithLab

Averages the provided colors in the L*a*b* color space and returns a new Color object. Identical to dW\Pigmentum\Color::average.

Example

Outputs:


dW\Pigmentum\Color::averageWithLCHab

Averages the provided colors in the LCH (L*a*b*) color space and returns a new Color object.

Example

Outputs:


dW\Pigmentum\Color::averageWithRGB

Averages the provided colors in the RGB color space and returns a new Color object.

Example

Outputs:


dW\Pigmentum\Color::averageWithHSB

Averages the provided colors in the HSB color space and returns a new Color object.

Example

Outputs:


dW\Pigmentum\Color::mix

Mixes the color with a provided color in the L*a*b* color space and returns a new Color object. Identical to dW\Pigmentum\Color::mixWithLab.

Example

Outputs:


dW\Pigmentum\Color::mixWithLab

Mixes the color with a provided color in the L*a*b* color space and returns a new Color object. Identical to dW\Pigmentum\Color::mix.

Example

Outputs:


dW\Pigmentum\Color::mixWithLCHab

Mixes the color with a provided color in the LCH (L*a*b*) color space and returns a new Color object.

Example

Outputs:


dW\Pigmentum\Color::mixWithRGB

Mixes the color with a provided color in the RGB color space and returns a new Color object.

Example

Outputs:


dW\Pigmentum\Color::mixWithHSB

Mixes the color with a provided color in the HSB color space and returns a new Color object.

Example

Outputs:


dW\Pigmentum\Color::apcaContrast

Calculate the APCA (indented for use with the future WCAG 3) contrast between a text color ($this) and a provided background color.

NOTE: This algorithm is in flux, and its results may change over time as the upstream reference algorithm is updated.

Example

Outputs:


dW\Pigmentum\Color::deltaE

Calculate the CIE2000 distance between $this and a supplied color. Identical to dW\Pigmentum\Color::distance.

Example

Outputs:


dW\Pigmentum\Color::distance

Calculate the CIE2000 distance between $this and a supplied color. The CIE2000 distance formula takes perception into account when calculating. Identical to dW\Pigmentum\Color::deltaE.

Example

Outputs:


dW\Pigmentum\Color::euclideanDistance

Calculate the geometric euclidean distance between $this and a supplied color. This does not take perception into account when calculating. See dW\Pigmentum\Color::deltaE for perceptual distance.

Example

Outputs:


dW\Pigmentum\Color::wcag2Contrast

Calculate the WCAG2 contrast between $this and a provided color.

NOTE: While this is currently the standard for the Web it is not terribly accurate nor correct in its assessment. Use only if you're legally bound to do so. Even though the APCA contrast algorithm is in flux it already is much more accurate than the WCAG2 contrast ratio.

Example

Outputs:

dW\Pigmentum\ColorSpace\Lab

Properties


dW\Pigmentum\ColorSpace\Lab::toLCHab

Returns the LCH (L*a*b*) color space for the color.

Example

Outputs:

dW\Pigmentum\ColorSpace\RGB

Properties


dW\Pigmentum\ColorSpace\RGB::changeProfile

Converts the color's profile and returns a RGB color space using the supplied profile.

Example

Outputs:


dW\Pigmentum\ColorSpace\RGB::toHex

Returns a RGB hex string for the color.

Example

Outputs:


dW\Pigmentum\ColorSpace\RGB::toHSB

Returns the HSB color space for the color.

Example

Outputs:

dW\Pigmentum\ColorSpace\XYZ

Properties


dW\Pigmentum\ColorSpace\XYZ::toLMS

Returns the LMS color space for the color.

Example

Outputs:


dW\Pigmentum\ColorSpace\XYZ::chromaticAdaptation

Converts an XYZ color from one illuminant to another.

Example

Outputs:

dW\Pigmentum\ColorSpace\Lab\LCHab

Properties

dW\Pigmentum\ColorSpace\RGB\HSB

Properties

dW\Pigmentum\ColorSpace\XYZ\LMS

Properties

dW\Pigmentum\Profile\RGB

This is the base abstract color profile class. All RGB color profiles must inherit from this.

dW\Pigmentum\Profile\RGB\AdobeRGB1998

dW\Pigmentum\Profile\RGB\DisplayP3

dW\Pigmentum\Profile\RGB\ProPhoto

dW\Pigmentum\Profile\RGB\Simple_sRGB

dW\Pigmentum\Profile\RGB\sRGB


All versions of pigmentum with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0.2
ext-dom Version *
ext-zip Version *
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dustinwilson/pigmentum contains the following files

Loading the files please wait ....